Module: Chargify

Defined in:
lib/chargify_api_ares.rb,
lib/chargify_api_ares.rb

Overview

Version check

Defined Under Namespace

Classes: Base, Component, Customer, Product, ProductFamily, Subscription, Usage

Constant Summary collapse

ARES_VERSIONS =
['2.3.4', '2.3.5', '2.3.8']

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



53
54
55
# File 'lib/chargify_api_ares.rb', line 53

def api_key
  @api_key
end

.formatObject

Returns the value of attribute format.



53
54
55
# File 'lib/chargify_api_ares.rb', line 53

def format
  @format
end

.siteObject

Returns the value of attribute site.



53
54
55
# File 'lib/chargify_api_ares.rb', line 53

def site
  @site
end

.subdomainObject

Returns the value of attribute subdomain.



53
54
55
# File 'lib/chargify_api_ares.rb', line 53

def subdomain
  @subdomain
end

Class Method Details

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Chargify)

    the object that the method was called on



55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/chargify_api_ares.rb', line 55

def configure
  yield self
  
  Base.user      = api_key
  Base.password  = 'X'
  
  if site.blank?
    Base.site                     = "https://#{subdomain}.chargify.com"
    Subscription::Component.site  = "https://#{subdomain}.chargify.com/subscriptions/:subscription_id"
  else
    Base.site                     = site
    Subscription::Component.site  = site + "/subscriptions/:subscription_id"
  end
end