Module: Recurly

Defined in:
lib/recurly.rb,
lib/recurly/js.rb,
lib/recurly/xml.rb,
lib/recurly/api.rb,
lib/recurly/plan.rb,
lib/rails/recurly.rb,
lib/recurly/money.rb,
lib/recurly/add_on.rb,
lib/recurly/helper.rb,
lib/recurly/coupon.rb,
lib/recurly/invoice.rb,
lib/recurly/version.rb,
lib/recurly/account.rb,
lib/recurly/address.rb,
lib/recurly/resource.rb,
lib/recurly/xml/rexml.rb,
lib/recurly/tax_detail.rb,
lib/recurly/api/errors.rb,
lib/recurly/redemption.rb,
lib/recurly/adjustment.rb,
lib/recurly/transaction.rb,
lib/recurly/subscription.rb,
lib/recurly/xml/nokogiri.rb,
lib/recurly/billing_info.rb,
lib/recurly/resource/pager.rb,
lib/recurly/resource/errors.rb,
lib/recurly/transaction/errors.rb,
lib/recurly/subscription_add_on.rb,
lib/recurly/resource/association.rb,
lib/recurly/api/net_http_adapter.rb,
lib/recurly/subscription/add_ons.rb,
lib/rails/generators/recurly/config_generator.rb

Overview

Recurly is a Ruby client for Recurly's REST API.

Defined Under Namespace

Modules: Helper, JS, Version Classes: API, Account, AddOn, Address, Adjustment, BillingInfo, ConfigGenerator, ConfigurationError, Coupon, Error, Invoice, Money, Plan, Railtie, Redemption, Resource, Subscription, SubscriptionAddOn, TaxDetail, Transaction, XML

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.api_keyString

Returns An API key.

Raises:



51
52
53
54
55
# File 'lib/recurly.rb', line 51

def api_key
  defined? @api_key and @api_key or raise(
    ConfigurationError, "Recurly.api_key not configured"
  )
end

.default_currencyString?



59
60
61
62
# File 'lib/recurly.rb', line 59

def default_currency
  return @default_currency if defined? @default_currency
  @default_currency = 'USD'
end

.loggerLogger?

Assigns a logger to log requests/responses and more.

Examples:

require 'logger'
Recurly.logger = Logger.new STDOUT

Rails applications automatically log to the Rails log:

Recurly.logger = Rails.logger

Turn off logging entirely:

Recurly.logger = nil # Or Recurly.logger = Logger.new nil


80
81
82
# File 'lib/recurly.rb', line 80

def logger
  @logger
end

.subdomainString



44
45
46
# File 'lib/recurly.rb', line 44

def subdomain
  @subdomain || 'api'
end

Class Method Details

.jsJS



66
67
68
# File 'lib/recurly.rb', line 66

def js
  JS
end

.log(level, message) ⇒ true?

Convenience logging method includes a Logger#progname dynamically.



84
85
86
# File 'lib/recurly.rb', line 84

def log level, message
  logger.send(level, name) { message }
end

Instance Method Details

#const_defined?(sym, inherit = false) ⇒ Boolean

Raises:

  • (ArgumentError)


89
90
91
92
# File 'lib/recurly.rb', line 89

def const_defined? sym, inherit = false
  raise ArgumentError, "inherit must be false" if inherit
  super sym
end

#const_get(sym, inherit = false) ⇒ Object

Raises:

  • (ArgumentError)


94
95
96
97
# File 'lib/recurly.rb', line 94

def const_get sym, inherit = false
  raise ArgumentError, "inherit must be false" if inherit
  super sym
end