Module: ActiveMerchant::Billing::Compatibility

Defined in:
lib/active_merchant/billing/compatibility.rb

Defined Under Namespace

Modules: Model

Class Method Summary collapse

Class Method Details

.deprecatedObject


21
22
23
24
25
26
# File 'lib/active_merchant/billing/compatibility.rb', line 21

def self.deprecated
  ActiveMerchant.deprecated(
    %(Implicit inclusion of Rails-specific functionality is deprecated.) +
    %( Explicitly require "active_merchant/billing/rails" if you need it.)
  ) unless @rails_required
end

.humanize(lower_case_and_underscored_word) ⇒ Object


28
29
30
31
32
33
34
35
# File 'lib/active_merchant/billing/compatibility.rb', line 28

def self.humanize(lower_case_and_underscored_word)
  result = lower_case_and_underscored_word.to_s.dup
  result.gsub!(/_id$/, "")
  result.gsub!(/_/, ' ')
  result.gsub(/([a-z\d]*)/i) { |match|
    match.downcase
  }.gsub(/^\w/) { $&.upcase }
end

.rails_required!Object


17
18
19
# File 'lib/active_merchant/billing/compatibility.rb', line 17

def self.rails_required!
  @rails_required = true
end