Class: Vertpig::Withdrawal
- Inherits:
-
Object
- Object
- Vertpig::Withdrawal
- Includes:
- Helpers
- Defined in:
- lib/vertpig/withdrawal.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#authorized ⇒ Object
readonly
Returns the value of attribute authorized.
-
#canceled ⇒ Object
readonly
Returns the value of attribute canceled.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#executed_at ⇒ Object
readonly
Returns the value of attribute executed_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#invalid_address ⇒ Object
readonly
Returns the value of attribute invalid_address.
-
#pending ⇒ Object
readonly
Returns the value of attribute pending.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#transaction_cost ⇒ Object
readonly
Returns the value of attribute transaction_cost.
-
#transaction_id ⇒ Object
readonly
Returns the value of attribute transaction_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Withdrawal
constructor
A new instance of Withdrawal.
Methods included from Helpers
Constructor Details
#initialize(attrs = {}) ⇒ Withdrawal
Returns a new instance of Withdrawal.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vertpig/withdrawal.rb', line 9 def initialize(attrs = {}) @id = attrs['PaymentUuid'] @currency = attrs['Currency'] @quantity = attrs['Amount'] @address = attrs['Address'] @authorized = attrs['Authorized'] @pending = attrs['PendingPayment'] @canceled = attrs['Canceled'] @invalid_address = attrs['Canceled'] @transaction_cost = attrs['TxCost'] @transaction_id = attrs['TxId'] @executed_at = (attrs['Opened']) @raw = attrs end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def address @address end |
#authorized ⇒ Object (readonly)
Returns the value of attribute authorized.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def @authorized end |
#canceled ⇒ Object (readonly)
Returns the value of attribute canceled.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def canceled @canceled end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def currency @currency end |
#executed_at ⇒ Object (readonly)
Returns the value of attribute executed_at.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def executed_at @executed_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def id @id end |
#invalid_address ⇒ Object (readonly)
Returns the value of attribute invalid_address.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def invalid_address @invalid_address end |
#pending ⇒ Object (readonly)
Returns the value of attribute pending.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def pending @pending end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def quantity @quantity end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def raw @raw end |
#transaction_cost ⇒ Object (readonly)
Returns the value of attribute transaction_cost.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def transaction_cost @transaction_cost end |
#transaction_id ⇒ Object (readonly)
Returns the value of attribute transaction_id.
5 6 7 |
# File 'lib/vertpig/withdrawal.rb', line 5 def transaction_id @transaction_id end |
Class Method Details
.all ⇒ Object
24 25 26 |
# File 'lib/vertpig/withdrawal.rb', line 24 def self.all client.get('account/getwithdrawalhistory').map{|data| new(data) } end |
.single(currency, quantity, address) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/vertpig/withdrawal.rb', line 28 def self.single(currency, quantity, address) client.get('account/withdraw', { currency: currency, quantity: quantity, address: address }) end |