Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/formotion/patch/object.rb
Instance Method Summary collapse
-
#swizzle(method, &block) ⇒ Object
Creates an alias for :method with the form old_#method Instance evals the block.
- #to_archived_data ⇒ Object
Instance Method Details
#swizzle(method, &block) ⇒ Object
Creates an alias for :method with the form old_#method Instance evals the block.
5 6 7 8 |
# File 'lib/formotion/patch/object.rb', line 5 def swizzle(method, &block) self.class.send(:alias_method, "old_#{method.to_s}".to_sym, method) self.instance_eval &block end |
#to_archived_data ⇒ Object
10 11 12 |
# File 'lib/formotion/patch/object.rb', line 10 def to_archived_data NSKeyedArchiver.archivedDataWithRootObject(self) end |