Method: AuthorizeNet::Model#initialize
- Defined in:
- lib/authorize_net/authorize_net.rb
#initialize(fields = {}) ⇒ Object
The constructor for models. Takes any of the supported attributes as key/value pairs.
132 133 134 135 136 137 138 139 |
# File 'lib/authorize_net/authorize_net.rb', line 132 def initialize(fields = {}) fields.each do |k, v| method_name = (k.to_s + '=').to_sym if self.respond_to?(method_name) self.send(method_name, v) end end end |