class ActiveMerchant::Billing::Rails::Model::Errors

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/active_merchant/billing/compatibility.rb, line 65
def initialize
  super(){|h, k| h[k] = []}
end

Public Instance Methods

[](key) click to toggle source
Calls superclass method
# File lib/active_merchant/billing/compatibility.rb, line 71
def [](key)
  super(key.to_s)
end
[]=(key, value) click to toggle source
Calls superclass method
# File lib/active_merchant/billing/compatibility.rb, line 75
def []=(key, value)
  super(key.to_s, value)
end
add(field, error) click to toggle source
# File lib/active_merchant/billing/compatibility.rb, line 87
def add(field, error)
  self[field] << error
end
add_to_base(error) click to toggle source
# File lib/active_merchant/billing/compatibility.rb, line 91
def add_to_base(error)
  add(:base, error)
end
each_full() { |msg| ... } click to toggle source
# File lib/active_merchant/billing/compatibility.rb, line 95
def each_full
  full_messages.each{|msg| yield msg}
end
empty?() click to toggle source
# File lib/active_merchant/billing/compatibility.rb, line 79
def empty?
  all?{|k, v| v && v.empty?}
end
full_messages() click to toggle source
# File lib/active_merchant/billing/compatibility.rb, line 99
def full_messages
  result = []

  self.each do |key, messages|
    next unless(messages && !messages.empty?)
    if key == 'base'
      result << "#{messages.first}"
    else
      result << "#{Compatibility.humanize(key)} #{messages.first}"
    end
  end

  result
end
on(field) click to toggle source
# File lib/active_merchant/billing/compatibility.rb, line 83
def on(field)
  self[field].to_a.first
end