Class: ChargifyApi::Connection

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, subdomain) ⇒ Connection

Returns a new instance of Connection.



5
6
7
8
9
# File 'lib/connection.rb', line 5

def initialize(api_key, subdomain)
  @api_key   = api_key
  @subdomain = subdomain
  @base_url  = "https://#{@subdomain}.chargify.com/"
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



3
4
5
# File 'lib/connection.rb', line 3

def options
  @options
end

Instance Method Details

#get(uri, query_string) ⇒ Object



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

def get(uri, query_string)
  HTTParty.get(@base_url + uri, options.merge(:query => query_string))
end