Class: Vertpig::Currency

Inherits:
Object
  • Object
show all
Defined in:
lib/vertpig/currency.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Currency

Returns a new instance of Currency.



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

def initialize(attrs = {})
  @name = attrs['CurrencyLong']
  @abbreviation = attrs['Currency']
  @transaction_fee = attrs['TxFee']
  @minimum_confirmation = attrs['MinConfirmation']
  @active = attrs['IsActive']
  @raw = attrs
end

Instance Attribute Details

#abbreviationObject (readonly)

Returns the value of attribute abbreviation.



3
4
5
# File 'lib/vertpig/currency.rb', line 3

def abbreviation
  @abbreviation
end

#activeObject (readonly)

Returns the value of attribute active.



3
4
5
# File 'lib/vertpig/currency.rb', line 3

def active
  @active
end

#minimum_confirmationObject (readonly) Also known as: min_confirmation

Returns the value of attribute minimum_confirmation.



3
4
5
# File 'lib/vertpig/currency.rb', line 3

def minimum_confirmation
  @minimum_confirmation
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/vertpig/currency.rb', line 3

def name
  @name
end

#rawObject (readonly)

Returns the value of attribute raw.



3
4
5
# File 'lib/vertpig/currency.rb', line 3

def raw
  @raw
end

#transaction_feeObject (readonly) Also known as: fee

Returns the value of attribute transaction_fee.



3
4
5
# File 'lib/vertpig/currency.rb', line 3

def transaction_fee
  @transaction_fee
end

Class Method Details

.allObject



17
18
19
# File 'lib/vertpig/currency.rb', line 17

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