Skip to content

Instantly share code, notes, and snippets.

@elcontrastador
Created August 7, 2011 00:50
Show Gist options
  • Save elcontrastador/1129936 to your computer and use it in GitHub Desktop.
Save elcontrastador/1129936 to your computer and use it in GitHub Desktop.
[lib (master)]$ irb
ruby-1.9.2-p180 :001 > require 'ip'
=> true
ruby-1.9.2-p180 :002 > ip = IP.new('10.10.10.10/24')
=> #<IP:0x000001012bde30>
ruby-1.9.2-p180 :003 > ip.to_s
=> "#<IP:0x000001012bde30>"
ruby-1.9.2-p180 :004 > ip.methods
=> [:nil?, :===, :=~, :!~, :eql?, :hash, :<=>, :class, :singleton_class, :clone, :dup, :initialize_dup, :initialize_clone, :taint, :tainted?, :untaint, :untrust, :untrusted?, :trust, :freeze, :frozen?, :to_s, :inspect, :methods, :singleton_methods, :protected_methods, :private_methods, :public_methods, :instance_variables, :instance_variable_get, :instance_variable_set, :instance_variable_defined?, :instance_of?, :kind_of?, :is_a?, :tap, :send, :public_send, :respond_to?, :respond_to_missing?, :extend, :display, :method, :public_method, :define_singleton_method, :__id__, :object_id, :to_enum, :enum_for, :==, :equal?, :!, :!=, :instance_eval, :instance_exec, :__send__]
ruby-1.9.2-p180 :005 > ip.methods.grep(/network/)
=> []
ruby-1.9.2-p180 :006 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment