Class: Barometer::Utils::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/barometer/utils/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query) ⇒ Api

Returns a new instance of Api



6
7
8
# File 'lib/barometer/utils/api.rb', line 6

def initialize(query)
  @query = query
end

Instance Attribute Details

#queryObject (readonly)

Returns the value of attribute query



4
5
6
# File 'lib/barometer/utils/api.rb', line 4

def query
  @query
end

Instance Method Details

#current_queryObject



10
11
12
# File 'lib/barometer/utils/api.rb', line 10

def current_query
  @query.converted_query if @query.respond_to?(:converted_query)
end

#getObject



25
26
27
# File 'lib/barometer/utils/api.rb', line 25

def get
  Utils::PayloadRequest.new(self).get
end

#paramsObject



17
18
19
# File 'lib/barometer/utils/api.rb', line 17

def params
  @query.to_param
end

#unwrap_nodesObject



21
22
23
# File 'lib/barometer/utils/api.rb', line 21

def unwrap_nodes
  []
end

#urlObject



14
15
# File 'lib/barometer/utils/api.rb', line 14

def url
end