Class: Etsy::BasicClient

Inherits:
Object
  • Object
show all
Defined in:
lib/etsy/basic_client.rb

Overview

BasicClient

Used for calling public API methods.

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ BasicClient

Create a new client that will connect to the specified host



11
12
13
# File 'lib/etsy/basic_client.rb', line 11

def initialize(host)
  @host = host
end

Instance Method Details

#clientObject

:nodoc:



15
16
17
# File 'lib/etsy/basic_client.rb', line 15

def client # :nodoc:
  @client ||= Net::HTTP.new(@host)
end

#get(endpoint) ⇒ Object

Fetch a raw response from the specified endpoint



21
22
23
# File 'lib/etsy/basic_client.rb', line 21

def get(endpoint)
  client.get(endpoint)
end