Class: JPath::Parser::Predicate

Inherits:
Object
  • Object
show all
Defined in:
lib/jpath/parser/formula.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression) ⇒ Predicate

Returns a new instance of Predicate.



7
8
9
# File 'lib/jpath/parser/formula.rb', line 7

def initialize(expression)
  @expression = expression
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



5
6
7
# File 'lib/jpath/parser/formula.rb', line 5

def expression
  @expression
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/jpath/parser/formula.rb', line 15

def to_s
  "[%s]" % expression
end

#true?(*args) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/jpath/parser/formula.rb', line 11

def true?(*args)
  expression.true?(*args)
end