Class: AutotaskApi::Expression
- Inherits:
-
Object
- Object
- AutotaskApi::Expression
- Defined in:
- lib/autotask_api/query.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(field, operator, value) ⇒ Expression
constructor
A new instance of Expression.
- #to_xml(xml) ⇒ Object
Constructor Details
#initialize(field, operator, value) ⇒ Expression
Returns a new instance of Expression.
75 76 77 78 79 |
# File 'lib/autotask_api/query.rb', line 75 def initialize(field, operator, value) @field = field @operator = operator @value = value end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
73 74 75 |
# File 'lib/autotask_api/query.rb', line 73 def field @field end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
73 74 75 |
# File 'lib/autotask_api/query.rb', line 73 def operator @operator end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
73 74 75 |
# File 'lib/autotask_api/query.rb', line 73 def value @value end |
Class Method Details
.from_hash(expression = {}) ⇒ Object
87 88 89 |
# File 'lib/autotask_api/query.rb', line 87 def self.from_hash(expression = {}) new(expression[:field], expression[:operator], expression[:value]) end |
Instance Method Details
#to_xml(xml) ⇒ Object
81 82 83 84 85 |
# File 'lib/autotask_api/query.rb', line 81 def to_xml(xml) xml.field field do xml.expression value, op: operator end end |