Class: Etsy::BasicClient
- Inherits:
-
Object
- Object
- Etsy::BasicClient
- Defined in:
- lib/etsy/basic_client.rb
Overview
BasicClient
Used for calling public API methods.
Instance Method Summary collapse
-
#client ⇒ Object
:nodoc:.
-
#get(endpoint) ⇒ Object
Fetch a raw response from the specified endpoint.
-
#initialize ⇒ BasicClient
constructor
Create a new client that will connect to the specified host.
Constructor Details
#initialize ⇒ 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 = Etsy.host end |
Instance Method Details
#client ⇒ Object
:nodoc:
15 16 17 18 19 20 21 22 23 |
# File 'lib/etsy/basic_client.rb', line 15 def client # :nodoc: if @client return @client else @client = Net::HTTP.new(@host, Etsy.protocol == "http" ? 80 : 443) @client.use_ssl = true if Etsy.protocol == "https" return @client end end |
#get(endpoint) ⇒ Object
Fetch a raw response from the specified endpoint
27 28 29 |
# File 'lib/etsy/basic_client.rb', line 27 def get(endpoint) client.get(endpoint) end |