Class: Undo::Model
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Undo::Model
- Extended by:
- Forwardable
- Defined in:
- lib/undo/model.rb
Instance Method Summary collapse
-
#initialize(object, options = {}) ⇒ Model
constructor
A new instance of Model.
- #method_missing(method, *args, &block) ⇒ Object
- #uuid ⇒ Object
Constructor Details
#initialize(object, options = {}) ⇒ Model
Returns a new instance of Model.
8 9 10 11 12 |
# File 'lib/undo/model.rb', line 8 def initialize(object, = {}) @object = object @config = config.with super object end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
18 19 20 21 |
# File 'lib/undo/model.rb', line 18 def method_missing(method, *args, &block) store if config.mutator_methods.include? method super method, *args, &block end |
Instance Method Details
#uuid ⇒ Object
14 15 16 |
# File 'lib/undo/model.rb', line 14 def uuid @uuid ||= object.respond_to?(:uuid) ? object.uuid : generate_uuid end |