Class: Tarquinn::Condition::MethodCaller

Inherits:
Object
  • Object
show all
Defined in:
lib/tarquinn/condition/method_caller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(methods) ⇒ MethodCaller

Returns a new instance of MethodCaller.



4
5
6
# File 'lib/tarquinn/condition/method_caller.rb', line 4

def initialize(methods)
  @methods = [methods].flatten
end

Instance Attribute Details

#methodsObject

Returns the value of attribute methods.



2
3
4
# File 'lib/tarquinn/condition/method_caller.rb', line 2

def methods
  @methods
end

Instance Method Details

#check?(controller) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
# File 'lib/tarquinn/condition/method_caller.rb', line 8

def check?(controller)
  methods.any? do |method|
    controller.call(method)
  end
end