Class: StickyBlox::BindingArray

Inherits:
Array
  • Object
show all
Defined in:
lib/sticky_blox/behavior.rb

Instance Method Summary collapse

Instance Method Details

#bind(object) ⇒ Object



10
11
12
13
# File 'lib/sticky_blox/behavior.rb', line 10

def bind(object)
  @binding = object
  self
end

#call(*args) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/sticky_blox/behavior.rb', line 15

def call(*args)
  value = @binding
  self.reject{|e| e.nil?}.each do |blk|
    value = blk.bind(value).call(*args)
  end
  value
end