Module: Cenit::API::HttpQuery

Included in:
HttpRequester
Defined in:
lib/cenit/api/http_query.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/cenit/api/http_query.rb', line 9

def method_missing(symbol, *args)
  case args.length
  when 0
    super
  when 1
    query[symbol] = args[0]
    self
  else
    query[symbol] = args.collect(&:to_s).flatten.join(',')
    self
  end
end

Instance Method Details

#queryObject



5
6
7
# File 'lib/cenit/api/http_query.rb', line 5

def query
  @query ||= {}
end