Class: Representable::Binding::Map
- Inherits:
-
Array
- Object
- Array
- Representable::Binding::Map
- Defined in:
- lib/representable/binding.rb
Instance Method Summary collapse
-
#<<(binding) ⇒ Object
TODO: Merge with Definitions.
- #call(method, options) ⇒ Object
Instance Method Details
#<<(binding) ⇒ Object
TODO: Merge with Definitions.
19 20 21 |
# File 'lib/representable/binding.rb', line 19 def <<(binding) # can be slow. this is compile time code. (existing = find { |bin| bin.name == binding.name }) ? self[index(existing)] = binding : super(binding) end |
#call(method, options) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/representable/binding.rb', line 11 def call(method, ) each do |bin| [:binding] = bin # this is so much faster than options.merge(). bin.send(method, ) end end |