Class: PuppetDBQuery::Operator
- Inherits:
-
Object
- Object
- PuppetDBQuery::Operator
- Defined in:
- lib/puppetdb_query/operator.rb
Overview
operator with priority and representation information
Instance Attribute Summary collapse
-
#infix ⇒ Object
readonly
Returns the value of attribute infix.
-
#maximum ⇒ Object
readonly
Returns the value of attribute maximum.
-
#minimum ⇒ Object
readonly
Returns the value of attribute minimum.
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #infix? ⇒ Boolean
-
#initialize(symbol, infix, priority, minimum, maximum = nil) ⇒ Operator
constructor
A new instance of Operator.
- #prefix? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(symbol, infix, priority, minimum, maximum = nil) ⇒ Operator
Returns a new instance of Operator.
13 14 15 16 17 18 19 20 |
# File 'lib/puppetdb_query/operator.rb', line 13 def initialize(symbol, infix, priority, minimum, maximum = nil) @symbol = symbol @infix = infix @priority = priority @minimum = minimum @maximum = maximum @string = Tokenizer.symbol_to_string(symbol) end |
Instance Attribute Details
#infix ⇒ Object (readonly)
Returns the value of attribute infix.
7 8 9 |
# File 'lib/puppetdb_query/operator.rb', line 7 def infix @infix end |
#maximum ⇒ Object (readonly)
Returns the value of attribute maximum.
10 11 12 |
# File 'lib/puppetdb_query/operator.rb', line 10 def maximum @maximum end |
#minimum ⇒ Object (readonly)
Returns the value of attribute minimum.
9 10 11 |
# File 'lib/puppetdb_query/operator.rb', line 9 def minimum @minimum end |
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
8 9 10 |
# File 'lib/puppetdb_query/operator.rb', line 8 def priority @priority end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
11 12 13 |
# File 'lib/puppetdb_query/operator.rb', line 11 def string @string end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
6 7 8 |
# File 'lib/puppetdb_query/operator.rb', line 6 def symbol @symbol end |
Instance Method Details
#==(other) ⇒ Object
30 31 32 |
# File 'lib/puppetdb_query/operator.rb', line 30 def ==(other) other.class == self.class && other.symbol == symbol end |
#infix? ⇒ Boolean
22 23 24 |
# File 'lib/puppetdb_query/operator.rb', line 22 def infix? infix end |
#prefix? ⇒ Boolean
26 27 28 |
# File 'lib/puppetdb_query/operator.rb', line 26 def prefix? !infix end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/puppetdb_query/operator.rb', line 34 def to_s @string end |