Class: TempoIQ::Query
- Inherits:
-
Object
- Object
- TempoIQ::Query
- Defined in:
- lib/tempoiq/models/query.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#pipeline ⇒ Object
readonly
Returns the value of attribute pipeline.
-
#search ⇒ Object
readonly
Returns the value of attribute search.
Instance Method Summary collapse
-
#initialize(search, action, pipeline = nil) ⇒ Query
constructor
A new instance of Query.
- #to_hash ⇒ Object
Constructor Details
#initialize(search, action, pipeline = nil) ⇒ Query
Returns a new instance of Query.
5 6 7 8 9 |
# File 'lib/tempoiq/models/query.rb', line 5 def initialize(search, action, pipeline = nil) @search = search @action = action @pipeline = pipeline end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/tempoiq/models/query.rb', line 3 def action @action end |
#pipeline ⇒ Object (readonly)
Returns the value of attribute pipeline.
3 4 5 |
# File 'lib/tempoiq/models/query.rb', line 3 def pipeline @pipeline end |
#search ⇒ Object (readonly)
Returns the value of attribute search.
3 4 5 |
# File 'lib/tempoiq/models/query.rb', line 3 def search @search end |
Instance Method Details
#to_hash ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/tempoiq/models/query.rb', line 11 def to_hash hash = { "search" => search.to_hash, action.name => action.to_hash } hash["fold"] = pipeline.to_hash if pipeline hash end |