Class: Bowline::Binders::Collection::ItemsProxy
- Defined in:
- lib/bowline/binders/collection.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ ItemsProxy
constructor
A new instance of ItemsProxy.
- #method_missing(*args, &block) ⇒ Object
- #real ⇒ Object
Constructor Details
#initialize(&block) ⇒ ItemsProxy
Returns a new instance of ItemsProxy.
5 6 7 8 |
# File 'lib/bowline/binders/collection.rb', line 5 def initialize(&block) @callback = block @items = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/bowline/binders/collection.rb', line 14 def method_missing(*args, &block) diff = @items.hash res = @items.send(*args, &block) if diff != @items.hash @callback.call end res end |
Instance Method Details
#real ⇒ Object
10 11 12 |
# File 'lib/bowline/binders/collection.rb', line 10 def real @items end |