Module: RSpreedly

Defined in:
lib/rspreedly.rb,
lib/rspreedly/base.rb,
lib/rspreedly/error.rb,
lib/rspreedly/config.rb,
lib/rspreedly/credit.rb,
lib/rspreedly/invoice.rb,
lib/rspreedly/line_item.rb,
lib/rspreedly/subscriber.rb,
lib/rspreedly/transaction.rb,
lib/rspreedly/payment_method.rb,
lib/rspreedly/subscription_plan.rb,
lib/rspreedly/complimentary_subscription.rb,
lib/rspreedly/complimentary_time_extension.rb,
lib/rspreedly/lifetime_complimentary_subscription.rb

Defined Under Namespace

Modules: Config, Error, PaymentMethod Classes: Base, ComplimentarySubscription, ComplimentaryTimeExtension, Credit, Invoice, LifetimeComplimentarySubscription, LineItem, Subscriber, SubscriptionPlan, Transaction

Class Method Summary collapse

Class Method Details

.underscore(camel_cased_word) ⇒ Object

pretty much stolen from Rails



23
24
25
26
27
28
29
# File 'lib/rspreedly.rb', line 23

def self.underscore(camel_cased_word)
  camel_cased_word.to_s.gsub(/\w+::/, '').
  gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
  gsub(/([a-z\d])([A-Z])/,'\1_\2').
  tr("-", "_").
  downcase
end