Class: PlayAsia::Api
- Inherits:
-
Object
- Object
- PlayAsia::Api
- Defined in:
- lib/play_asia/api.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Api
constructor
A new instance of Api.
- #listing(opts = {}) ⇒ Object
- #query(opts = {}) ⇒ Object
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
#headers ⇒ Object
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 |