Module: AuthorizeNet::Model

Defined in:
lib/authorize_net/authorize_net.rb

Overview

Provides some basic methods used by the various model classes.

Instance Method Summary collapse

Instance Method Details

#initialize(fields = {}) ⇒ Object

The constructor for models. Takes any of the supported attributes as key/value pairs.



136
137
138
139
140
141
# File 'lib/authorize_net/authorize_net.rb', line 136

def initialize(fields = {})
  fields.each do |k, v|
    method_name = (k.to_s + '=').to_sym
    send(method_name, v) if respond_to?(method_name)
  end
end

#to_aObject



143
144
145
# File 'lib/authorize_net/authorize_net.rb', line 143

def to_a
  [self]
end