Method: Horza::Entities::Collection#method_missing
- Defined in:
- lib/horza/entities/collection.rb
#method_missing(method, &block) ⇒ Object (private)
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/horza/entities/collection.rb', line 16 def method_missing(method, &block) if [:length, :size, :empty?, :present?].include? method @collection.send(method) elsif [:first, :last, :pop].include? method result = @collection.send(method) singular_entity(result) unless result.nil? elsif [:each, :map, :collect] enum_method(method, &block) end end |