Class: Client
- Inherits:
-
Object
- Object
- Client
- Defined in:
- lib/domain_com_au/client.rb
Instance Method Summary collapse
- #get_token ⇒ Object
-
#initialize(client_id, client_secret) ⇒ Client
constructor
A new instance of Client.
- #search_listings(type, params = {}) ⇒ Object
- #show_listing(id) ⇒ Object
Constructor Details
#initialize(client_id, client_secret) ⇒ Client
Returns a new instance of Client.
5 6 7 |
# File 'lib/domain_com_au/client.rb', line 5 def initialize(client_id, client_secret) @http_client = HttpClient.new(client_id, client_secret) end |
Instance Method Details
#get_token ⇒ Object
9 10 11 |
# File 'lib/domain_com_au/client.rb', line 9 def get_token @http_client.auth_token end |
#search_listings(type, params = {}) ⇒ Object
13 14 15 |
# File 'lib/domain_com_au/client.rb', line 13 def search_listings(type, params={}) DomainListing.index(@http_client, type, params) end |
#show_listing(id) ⇒ Object
17 18 19 |
# File 'lib/domain_com_au/client.rb', line 17 def show_listing(id) DomainListing.show(@http_client, id) end |