Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/plist4r/mixin/ruby_stdlib.rb,
lib/plist4r/mixin/mixlib_config.rb
Overview
These methods should all be nemespaced to ::Plist4r we don’t want to upset anyone else’s code
Instance Method Summary collapse
-
#deep_clone ⇒ Object
Make a deep copy of an object.
- #meta_def(name, &blk) ⇒ Object
-
#method_name ⇒ String
The method name my_method => “my_method”.
Instance Method Details
#deep_clone ⇒ Object
Make a deep copy of an object. Including a deep copy of all the object’s instance data.
24 |
# File 'lib/plist4r/mixin/ruby_stdlib.rb', line 24 def deep_clone; Marshal::load(Marshal.dump(self)); end |
#meta_def(name, &blk) ⇒ Object
8 9 10 |
# File 'lib/plist4r/mixin/mixlib_config.rb', line 8 def name, &blk (class << self; self; end).instance_eval { define_method name, &blk } end |
#method_name ⇒ String
The method name my_method => “my_method”
13 14 15 16 17 18 |
# File 'lib/plist4r/mixin/ruby_stdlib.rb', line 13 def method_name if /`(.*)'/.match(caller.first) return $1 end nil end |