Skip to content

Instantly share code, notes, and snippets.

@lancelakey
Created July 27, 2012 02:52
Show Gist options
  • Save lancelakey/3185936 to your computer and use it in GitHub Desktop.
Save lancelakey/3185936 to your computer and use it in GitHub Desktop.
irb pry
[14] pry(main)> cd a
[15] pry(#<Fog::Compute::AWS::Server>):1> ls
Fog::Attributes::InstanceMethods#methods: _dump attributes dup identity identity= merge_attributes new_record? requires requires_one
Fog::Model#methods: collection collection= connection connection= inspect reload symbolize_keys to_json wait_for
Fog::Compute::Server#methods: scp scp_download scp_upload ssh ssh_port sshable?
Fog::Compute::AWS::Server#methods: addresses ami_launch_index ami_launch_index= architecture architecture= availability_zone availability_zone= block_device_mapping block_device_mapping= client_token client_token= console_output created_at created_at= destroy dns_name dns_name= flavor flavor= flavor_id flavor_id= groups groups= iam_instance_profile iam_instance_profile= iam_instance_profile_arn= iam_instance_profile_name= id id= image_id image_id= instance_initiated_shutdown_behavior instance_initiated_shutdown_behavior= ip_address kernel_id kernel_id= key_name key_name= key_pair key_pair= monitor= monitoring monitoring= network_interfaces network_interfaces= password password= placement_group placement_group= platform platform= private_dns_name private_dns_name= private_ip_address private_ip_address= private_key private_key= private_key_path private_key_path= product_codes product_codes= public_ip_address public_ip_address= public_key public_key= public_key_path public_key_path= ramdisk_id ramdisk_id= ready? reason reason= reboot root_device_name root_device_name= root_device_type root_device_type= save security_group_ids security_group_ids= setup start state state= state_reason state_reason= stop subnet_id subnet_id= tags tags= tenancy tenancy= user_data user_data= username username= volumes vpc_id vpc_id=
self.methods: __binding_impl__
instance variables: @architecture @attributes @collection @connection @username
locals: _ _dir_ _ex_ _file_ _in_ _out_ _pry_
[16] pry(#<Fog::Compute::AWS::Server>):1>
```ruby
~ > irb
irb(main):001:0> x = "smurf"
=> "smurf"
irb(main):002:0> x.methods
=> ["upcase!", "zip", "find_index", "between?", "unpack", "each_slice", "to_f", "minmax", "lines", "sub", "methods", "send", "replace", "empty?", "group_by", "squeeze", "crypt", "gsub!", "taint", "instance_variable_defined?", "match", "downcase!", "take", "find_all", "min_by", "bytes", "enum_slice", "entries", "gsub", "singleton_methods", "instance_eval", "to_str", "first", "chop!", "intern", "nil?", "succ", "capitalize!", "take_while", "select", "max_by", "chars", "each_cons", "tr!", "protected_methods", "instance_exec", "display", "sort", "chop", "tainted?", "dump", "include?", "untaint", "instance_of?", "chomp!", "swapcase!", "drop", "equal?", "reject", "hex", "minmax_by", "sum", "enum_cons", "hash", "private_methods", "all?", "tr_s!", "sort_by", "chomp", "upcase", "method", "start_with?", "succ!", "kind_of?", "strip!", "freeze", "drop_while", "eql?", "next", "collect", "oct", "id", "slice", "casecmp", "grep", "strip", "any?", "delete!", "public_methods", "end_with?", "downcase", "%", "is_a?", "scan", "lstrip!", "cycle", "map", "member?", "tap", "type", "*", "split", "insert", "each_with_index", "+", "count", "lstrip", "one?", "squeeze!", "instance_variables", "__id__", "frozen?", "capitalize", "next!", "each_line", "object_id", "rstrip!", "to_a", "ljust", "respond_to?", "upto", "each", "inject", "tr", "slice!", "class", "reverse", "length", "enum_with_index", "rpartition", "rstrip", "<=>", "none?", "instance_variable_get", "find", "==", "swapcase", "__send__", "===", "min", "each_byte", "to_enum", "extend", "to_s", "rjust", "index", ">=", "size", "reduce", "tr_s", "<=", "clone", "reverse_each", "to_sym", "bytesize", "=~", "instance_variable_set", "<", "detect", "max", "each_char", "enum_for", ">", "to_i", "center", "inspect", "[]", "reverse!", "rindex", "partition", "delete", "[]=", "concat", "sub!", "dup", "<<"]
irb(main):003:0>
irb(main):004:0* x.methods.sort
=> ["%", "*", "+", "<", "<<", "<=", "<=>", "==", "===", "=~", ">", ">=", "[]", "[]=", "__id__", "__send__", "all?", "any?", "between?", "bytes", "bytesize", "capitalize", "capitalize!", "casecmp", "center", "chars", "chomp", "chomp!", "chop", "chop!", "class", "clone", "collect", "concat", "count", "crypt", "cycle", "delete", "delete!", "detect", "display", "downcase", "downcase!", "drop", "drop_while", "dump", "dup", "each", "each_byte", "each_char", "each_cons", "each_line", "each_slice", "each_with_index", "empty?", "end_with?", "entries", "enum_cons", "enum_for", "enum_slice", "enum_with_index", "eql?", "equal?", "extend", "find", "find_all", "find_index", "first", "freeze", "frozen?", "grep", "group_by", "gsub", "gsub!", "hash", "hex", "id", "include?", "index", "inject", "insert", "inspect", "instance_eval", "instance_exec", "instance_of?", "instance_variable_defined?", "instance_variable_get", "instance_variable_set", "instance_variables", "intern", "is_a?", "kind_of?", "length", "lines", "ljust", "lstrip", "lstrip!", "map", "match", "max", "max_by", "member?", "method", "methods", "min", "min_by", "minmax", "minmax_by", "next", "next!", "nil?", "none?", "object_id", "oct", "one?", "partition", "private_methods", "protected_methods", "public_methods", "reduce", "reject", "replace", "respond_to?", "reverse", "reverse!", "reverse_each", "rindex", "rjust", "rpartition", "rstrip", "rstrip!", "scan", "select", "send", "singleton_methods", "size", "slice", "slice!", "sort", "sort_by", "split", "squeeze", "squeeze!", "start_with?", "strip", "strip!", "sub", "sub!", "succ", "succ!", "sum", "swapcase", "swapcase!", "taint", "tainted?", "take", "take_while", "tap", "to_a", "to_enum", "to_f", "to_i", "to_s", "to_str", "to_sym", "tr", "tr!", "tr_s", "tr_s!", "type", "unpack", "untaint", "upcase", "upcase!", "upto", "zip"]
irb(main):005:0>
```
```ruby
/tmp > pry
[1] pry(main)>
[2] pry(main)> x = "smurf"
=> "smurf"
[3] pry(main)> cd x
[4] pry("smurf"):1> ls
Comparable#methods: < <= > >= between?
String#methods: % * + << <=> == === =~ [] []= ascii_only? bytes bytesize capitalize capitalize! casecmp center chars chomp chomp! chop chop! chr clear codepoints concat count crypt delete delete! downcase downcase! dump each_byte each_char each_codepoint each_line empty? encode encode! encoding end_with? eql? force_encoding getbyte gsub gsub! hash hex include? index insert inspect intern length lines ljust lstrip lstrip! match next next! oct ord partition replace reverse reverse! rindex rjust rpartition rstrip rstrip! scan setbyte shellescape shellsplit size slice slice! split squeeze squeeze! start_with? strip strip! sub sub! succ succ! sum swapcase swapcase! to_c to_f to_i to_r to_s to_str to_sym tr tr! tr_s tr_s! unpack upcase upcase! upto valid_encoding?
self.methods: __binding_impl__
locals: _ _dir_ _ex_ _file_ _in_ _out_ _pry_
[5] pry("smurf"):1>
```
```ruby
[9] pry(main)> x = %w[alpha bravo charlie]
=> ["alpha", "bravo", "charlie"]
[10] pry(main)> x.class
=> Array
[11] pry(main)>
[12] pry(main)> cd x
[13] pry(#<Array>):1>
[14] pry(#<Array>):1>
[15] pry(#<Array>):1> ls
Enumerable#methods: all? any? chunk collect_concat detect each_cons each_entry each_slice each_with_index each_with_object entries find find_all flat_map grep group_by inject max max_by member? min min_by minmax minmax_by none? one? partition reduce slice_before sort_by
Array#methods: & * + - << <=> == [] []= assoc at clear collect collect! combination compact compact! concat count cycle delete delete_at delete_if drop drop_while each each_index empty? eql? fetch fill find_index first flatten flatten! frozen? hash include? index insert inspect join keep_if last length map map! pack permutation pop pretty_print pretty_print_cycle product push rassoc reject reject! repeated_combination repeated_permutation replace reverse reverse! reverse_each rindex rotate rotate! sample select select! shelljoin shift shuffle shuffle! size slice slice! sort sort! sort_by! take take_while to_a to_ary to_s transpose uniq uniq! unshift values_at zip |
self.methods: __binding_impl__
locals: _ _dir_ _ex_ _file_ _in_ _out_ _pry_
[16] pry(#<Array>):1>
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment