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

+ (String) api_key

Returns 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

+ (String?) 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

+ (Logger?) logger

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


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

def logger
  @logger
end

Class Method Details

+ (JS) js



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

def js
  JS
end

+ (true?) log(level, message)

Convenience logging method includes a Logger#progname dynamically.



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

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