Class: Predicator::Predicates::Method

Inherits:
Object
  • Object
show all
Defined in:
lib/predicator/predicates/method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, method) ⇒ Method

Returns a new instance of Method.



6
7
8
9
# File 'lib/predicator/predicates/method.rb', line 6

def initialize value, method
  @value = value
  @method = method
end

Instance Attribute Details

#methodObject (readonly)

Returns the value of attribute method.



4
5
6
# File 'lib/predicator/predicates/method.rb', line 4

def method
  @method
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/predicator/predicates/method.rb', line 4

def value
  @value
end

Instance Method Details

#satisfied?(context = Predicator::Context.new) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'lib/predicator/predicates/method.rb', line 11

def satisfied? context=Predicator::Context.new
  node = context.node_for value
  node.send method
end