Class: TempoIQ::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/tempoiq/models/query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#actionObject (readonly)

Returns the value of attribute action.



3
4
5
# File 'lib/tempoiq/models/query.rb', line 3

def action
  @action
end

#pipelineObject (readonly)

Returns the value of attribute pipeline.



3
4
5
# File 'lib/tempoiq/models/query.rb', line 3

def pipeline
  @pipeline
end

#searchObject (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_hashObject



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