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.
77 78 79 80 81 |
# File 'lib/autotask_api/query.rb', line 77 def initialize(field, operator, value) @field = field @operator = operator @value = value end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
75 76 77 |
# File 'lib/autotask_api/query.rb', line 75 def field @field end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
75 76 77 |
# File 'lib/autotask_api/query.rb', line 75 def operator @operator end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
75 76 77 |
# File 'lib/autotask_api/query.rb', line 75 def value @value end |
Class Method Details
.from_hash(expression = {}) ⇒ Object
89 90 91 |
# File 'lib/autotask_api/query.rb', line 89 def self.from_hash(expression = {}) new(expression[:field], expression[:operator], expression[:value]) end |
Instance Method Details
#to_xml(xml) ⇒ Object
83 84 85 86 87 |
# File 'lib/autotask_api/query.rb', line 83 def to_xml(xml) xml.field field do xml.expression value, op: operator end end |