Module: Recurly

Defined in:
lib/recurly.rb,
lib/recurly/js.rb,
lib/recurly/api.rb,
lib/recurly/xml.rb,
lib/recurly/plan.rb,
lib/rails/recurly.rb,
lib/recurly/money.rb,
lib/recurly/helper.rb,
lib/recurly/coupon.rb,
lib/recurly/add_on.rb,
lib/recurly/account.rb,
lib/recurly/invoice.rb,
lib/recurly/version.rb,
lib/recurly/resource.rb,
lib/recurly/xml/rexml.rb,
lib/recurly/adjustment.rb,
lib/recurly/redemption.rb,
lib/recurly/api/errors.rb,
lib/recurly/transaction.rb,
lib/recurly/subscription.rb,
lib/recurly/billing_info.rb,
lib/recurly/xml/nokogiri.rb,
lib/recurly/resource/pager.rb,
lib/recurly/transaction/errors.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, Adjustment, BillingInfo, ConfigGenerator, ConfigurationError, Coupon, Error, Invoice, Money, Plan, Railtie, Redemption, Resource, Subscription, Transaction, XML

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyString

Returns An API key.

Returns:

  • (String)

    An API key.

Raises:



40
41
42
43
44
# File 'lib/recurly.rb', line 40

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

.default_currencyString?

Returns A default currency.

Returns:

  • (String, nil)

    A default currency.



48
49
50
51
# File 'lib/recurly.rb', line 48

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

Returns:

  • (Logger, nil)


69
70
71
# File 'lib/recurly.rb', line 69

def logger
  @logger
end

Class Method Details

.jsJS

Returns The Recurly.js module.

Returns:

  • (JS)

    The Recurly.js module.



55
56
57
# File 'lib/recurly.rb', line 55

def js
  JS
end

.log(level, message) ⇒ true?

Convenience logging method includes a Logger#progname dynamically.

Returns:

  • (true, nil)


73
74
75
# File 'lib/recurly.rb', line 73

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