Class: Predicated::TreetopUrlPart::OperationNode

Inherits:
Treetop::Runtime::SyntaxNode
  • Object
show all
Defined in:
lib/predicated/from/url_part.rb

Constant Summary collapse

SIGN_TO_PREDICATE_CLASS =
{
  "=" => Equal, 
  ">" => GreaterThan,
  "<" => LessThan,
  ">=" => GreaterThanOrEqualTo,
  "<=" => LessThanOrEqualTo
}

Instance Method Summary collapse

Instance Method Details

#left_textObject



58
# File 'lib/predicated/from/url_part.rb', line 58

def left_text; elements[0].text_value end

#right_textObject



60
# File 'lib/predicated/from/url_part.rb', line 60

def right_text; elements[2].text_value end

#sign_textObject



59
# File 'lib/predicated/from/url_part.rb', line 59

def sign_text; elements[1].text_value end

#to_predicateObject



70
71
72
# File 'lib/predicated/from/url_part.rb', line 70

def to_predicate
  SIGN_TO_PREDICATE_CLASS[sign_text].new(left_text, right_text)
end