class Bitstamper::Models::Deposit

Constants

MAPPING

Attributes

address[RW]
amount[RW]
confirmations[RW]

Public Class Methods

new(hash) click to toggle source
# File lib/bitstamper/models/deposit.rb, line 12
def initialize(hash)
  hash.each do |key, value|
    type            =     ::Bitstamper::Models::Deposit::MAPPING.fetch(key, nil)
    value           =     value && type ? ::Bitstamper::Utilities::convert_value(value, type) : value
    self.send("#{key}=", value) if self.respond_to?(key)
  end
end
parse(data) click to toggle source
# File lib/bitstamper/models/deposit.rb, line 20
def self.parse(data)
  data&.collect { |item| ::Bitstamper::Models::Deposit.new(item) }
end