Class: PlayAsia::Api

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Api

Returns a new instance of Api.



4
5
6
7
# File 'lib/play_asia/api.rb', line 4

def initialize(opts = {})
  @opts = opts
  @http_client = PlayAsia::HttpClient.new
end

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



2
3
4
# File 'lib/play_asia/api.rb', line 2

def headers
  @headers
end

Instance Method Details

#listing(opts = {}) ⇒ Object



15
16
17
18
19
# File 'lib/play_asia/api.rb', line 15

def listing(opts = {})
  query = PlayAsia::ListingQuery.new http_client
  query.build(@headers || {}, @opts.merge(opts))
  query
end

#query(opts = {}) ⇒ Object



9
10
11
12
13
# File 'lib/play_asia/api.rb', line 9

def query(opts = {})
  query = PlayAsia::Query.new http_client
  query.build(@headers || {}, @opts.merge(opts))
  query
end