Class: Vertpig::Deposit

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/vertpig/deposit.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#extract_timestamp

Constructor Details

#initialize(attrs = {}) ⇒ Deposit

Returns a new instance of Deposit.



8
9
10
11
12
13
14
15
16
17
# File 'lib/vertpig/deposit.rb', line 8

def initialize(attrs = {})
  @id = attrs['Id']
  @transaction_id = attrs['TxId']
  @address = attrs['CryptoAddress']
  @quantity = attrs['Amount']
  @currency = attrs['Currency']
  @confirmations = attrs['Confirmations']
  @executed_at = extract_timestamp(attrs['LastUpdated'])
  @raw = attrs
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



5
6
7
# File 'lib/vertpig/deposit.rb', line 5

def address
  @address
end

#confirmationsObject (readonly)

Returns the value of attribute confirmations.



5
6
7
# File 'lib/vertpig/deposit.rb', line 5

def confirmations
  @confirmations
end

#currencyObject (readonly)

Returns the value of attribute currency.



5
6
7
# File 'lib/vertpig/deposit.rb', line 5

def currency
  @currency
end

#executed_atObject (readonly)

Returns the value of attribute executed_at.



5
6
7
# File 'lib/vertpig/deposit.rb', line 5

def executed_at
  @executed_at
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/vertpig/deposit.rb', line 5

def id
  @id
end

#quantityObject (readonly)

Returns the value of attribute quantity.



5
6
7
# File 'lib/vertpig/deposit.rb', line 5

def quantity
  @quantity
end

#rawObject (readonly)

Returns the value of attribute raw.



6
7
8
# File 'lib/vertpig/deposit.rb', line 6

def raw
  @raw
end

#transaction_idObject (readonly)

Returns the value of attribute transaction_id.



5
6
7
# File 'lib/vertpig/deposit.rb', line 5

def transaction_id
  @transaction_id
end

Class Method Details

.allObject



19
20
21
# File 'lib/vertpig/deposit.rb', line 19

def self.all
  client.get('account/getdeposithistory').map{|data| new(data) }
end