Class: Undo::Wrapper
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Undo::Wrapper
- Extended by:
- Forwardable
- Defined in:
- lib/undo/wrapper.rb,
lib/undo/wrapper/configuration.rb
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#undo_uuid ⇒ Object
readonly
Returns the value of attribute undo_uuid.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(object, options) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
29 30 31 32 |
# File 'lib/undo/wrapper.rb', line 29 def method_missing(method, *args, &block) store if config.store_on.include? method super method, *args, &block end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
19 20 21 |
# File 'lib/undo/wrapper.rb', line 19 def config @config end |
#undo_uuid ⇒ Object (readonly)
Returns the value of attribute undo_uuid.
19 20 21 |
# File 'lib/undo/wrapper.rb', line 19 def undo_uuid @undo_uuid end |
Class Method Details
.config ⇒ Object
12 13 14 |
# File 'lib/undo/wrapper.rb', line 12 def self.config @config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
8 9 10 |
# File 'lib/undo/wrapper.rb', line 8 def self.configure yield config end |