class Bitstamper::Models::Withdrawal

Constants

MAPPING
STATUS
TYPES

Attributes

address[RW]
amount[RW]
currency[RW]
datetime[RW]
id[RW]
status[RW]
transaction_id[RW]
type[RW]

Public Class Methods

new(hash) click to toggle source
# File lib/bitstamper/models/withdrawal.rb, line 36
def initialize(hash)
  hash.each do |key, value|
    type            =     ::Bitstamper::Models::Withdrawal::MAPPING.fetch(key, nil)
    value           =     value && type ? ::Bitstamper::Utilities::convert_value(value, type) : value
    self.send("#{key}=", value) if self.respond_to?(key)
  end
  
  self.type         =   TYPES[self.type]
  self.status       =   STATUS[self.status]
end
parse(data) click to toggle source
# File lib/bitstamper/models/withdrawal.rb, line 47
def self.parse(data)
  data&.collect { |item| ::Bitstamper::Models::Withdrawal.new(item) }
end