Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/is/monkey/copy.rb,
lib/is/monkey/anyproc.rb,
lib/is/monkey/properties.rb
Instance Method Summary collapse
Instance Method Details
#copy ⇒ Object
6 7 8 |
# File 'lib/is/monkey/copy.rb', line 6 def copy Marshal.load(Marshal.dump(self)) end |
#property_values(*args) ⇒ Hash{Symbol => Object}
103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/is/monkey/properties.rb', line 103 def property_values *args result = {} if args.size != 0 args.each do |arg| prop = arg.intern result[prop] = send prop end else singleton_class.properties.each do |prop, _| result[prop] = send prop end end result end |
#to_proc ⇒ Proc?
6 7 8 9 10 11 12 |
# File 'lib/is/monkey/anyproc.rb', line 6 def to_proc if respond_to? :call method(:call).to_proc else nil end end |