Class: ODDB::Html::Util::UnsavedHelper
- Inherits:
-
Object
- Object
- ODDB::Html::Util::UnsavedHelper
- Defined in:
- lib/oddb/html/util/unsaved_helper.rb
Instance Attribute Summary collapse
-
#delegate ⇒ Object
readonly
Returns the value of attribute delegate.
Instance Method Summary collapse
-
#initialize(delegate) ⇒ UnsavedHelper
constructor
A new instance of UnsavedHelper.
- #method_missing(key, *args, &block) ⇒ Object
Constructor Details
#initialize(delegate) ⇒ UnsavedHelper
Returns a new instance of UnsavedHelper.
9 10 11 |
# File 'lib/oddb/html/util/unsaved_helper.rb', line 9 def initialize(delegate) @delegate = delegate end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(key, *args, &block) ⇒ Object
12 13 14 15 16 |
# File 'lib/oddb/html/util/unsaved_helper.rb', line 12 def method_missing(key, *args, &block) unless /^(add_|save$)/.match(key.to_s) @delegate.send(key, *args, &block) end end |
Instance Attribute Details
#delegate ⇒ Object (readonly)
Returns the value of attribute delegate.
8 9 10 |
# File 'lib/oddb/html/util/unsaved_helper.rb', line 8 def delegate @delegate end |