Class: Arspy::Operators::Interpreter::AssociationInterpreter
- Inherits:
-
Base
- Object
- Base
- Arspy::Operators::Interpreter::AssociationInterpreter
show all
- Defined in:
- lib/arspy/operators/interpreter/association_interpreter.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Class Method Details
.applies?(array, method_name) ⇒ Boolean
7
8
9
|
# File 'lib/arspy/operators/interpreter/association_interpreter.rb', line 7
def self.applies?(array, method_name)
array.first.class.reflect_on_all_associations.detect{|a| a.name == method_name}
end
|
Instance Method Details
#interpret(*args) ⇒ Object
11
12
13
|
# File 'lib/arspy/operators/interpreter/association_interpreter.rb', line 11
def interpret(*args)
@array.map(&@method_name).flatten
end
|