class Bitstamp::Model

Attributes

error[RW]
message[RW]
reason[RW]

Public Class Methods

new(attributes = {}) click to toggle source
# File lib/bitstamp/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/bitstamp/model.rb, line 25
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/bitstamp/model.rb, line 14
def attributes=(attributes = {})
  attributes.each do |name, value|
    begin
      send("#{name}=", value)
    rescue NoMethodError => e
      puts "Unable to assign #{name}. No such method."
    end
  end
end