class Bitso::Model
Attributes
error[RW]
message[RW]
Public Class Methods
new(attributes = {})
click to toggle source
# File lib/bitso/model.rb, line 9 def initialize(attributes = {}) self.attributes = attributes end
Public Instance Methods
attributes()
click to toggle source
Returns a hash with the current instance variables
# File lib/bitso/model.rb, line 26 def attributes Hash[instance_variables.map { |name| [name, instance_variable_get(name)] }] end
attributes=(attributes = {})
click to toggle source
Set the attributes based on the given hash
# File lib/bitso/model.rb, line 14 def attributes=(attributes = {}) attributes.each do |name, value| begin send("#{name}=", value) rescue NoMethodError => e puts "#{e.backtrace.join("\n\t")}" puts "Unable to assign #{name}. No such method." end end end