Module: Chargify

Defined in:
lib/chargify_api_ares/config.rb,
lib/chargify_api_ares/resources/base.rb,
lib/chargify_api_ares/resources/site.rb,
lib/chargify_api_ares/resources/usage.rb,
lib/chargify_api_ares/resources/coupon.rb,
lib/chargify_api_ares/resources/product.rb,
lib/chargify_api_ares/resources/customer.rb,
lib/chargify_api_ares/resources/component.rb,
lib/chargify_api_ares/resources/statement.rb,
lib/chargify_api_ares/resources/transaction.rb,
lib/chargify_api_ares/resources/subscription.rb,
lib/chargify_api_ares/resources/product_family.rb,
lib/chargify_api_ares/resources/payment_profile.rb

Defined Under Namespace

Classes: Base, Component, Coupon, Customer, PaymentProfile, Product, ProductFamily, Site, Statement, Subscription, Transaction, Usage

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



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

def api_key
  @api_key
end

.formatObject

Returns the value of attribute format.



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

def format
  @format
end

.siteObject

Returns the value of attribute site.



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

def site
  @site
end

.subdomainObject

Returns the value of attribute subdomain.



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

def subdomain
  @subdomain
end

.timeoutObject

Returns the value of attribute timeout.



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

def timeout
  @timeout
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Chargify)

    the object that the method was called on



5
6
7
8
9
10
11
12
13
14
# File 'lib/chargify_api_ares/config.rb', line 5

def configure
  yield self

  Base.user      = api_key
  Base.password  = 'X'
  Base.timeout   = timeout unless (timeout.blank?)
  
  self.site ||= "https://#{subdomain}.chargify.com"
  Base.site = site
end