Class: ODDB::Html::Util::UnsavedHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/oddb/html/util/unsaved_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#delegateObject (readonly)

Returns the value of attribute delegate.



8
9
10
# File 'lib/oddb/html/util/unsaved_helper.rb', line 8

def delegate
  @delegate
end