Class: Arspy::Operators::Interpreter::MethodInterpreter

Inherits:
AttributeInterpreter show all
Defined in:
lib/arspy/operators/interpreter/method_interpreter.rb

Class Method Summary collapse

Methods inherited from AttributeInterpreter

#interpret

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Arspy::Operators::Interpreter::Base

Class Method Details

.applies?(array, method_name) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/arspy/operators/interpreter/method_interpreter.rb', line 6

def self.applies?(array, method_name)
  array.first.respond_to?(method_name) && array.first.method(method_name).arity == 0
end