Class: CoinSync::Importers::Changelly::HistoryEntry
- Inherits:
-
Object
- Object
- CoinSync::Importers::Changelly::HistoryEntry
- Defined in:
- lib/coinsync/importers/changelly.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#exchanged_amount ⇒ Object
Returns the value of attribute exchanged_amount.
-
#exchanged_currency ⇒ Object
Returns the value of attribute exchanged_currency.
-
#received_amount ⇒ Object
Returns the value of attribute received_amount.
-
#received_currency ⇒ Object
Returns the value of attribute received_currency.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(line) ⇒ HistoryEntry
constructor
A new instance of HistoryEntry.
Constructor Details
#initialize(line) ⇒ HistoryEntry
Returns a new instance of HistoryEntry.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/coinsync/importers/changelly.rb', line 17 def initialize(line) @status = line[0] @date = Time.parse(line[1] + ' +0000') amount, name = line[2].gsub(',', '').split(/\s+/) @exchanged_currency = CryptoCurrency.new(name) @exchanged_amount = BigDecimal.new(amount) amount, name = line[6].gsub(',', '').split(/\s+/) @received_currency = CryptoCurrency.new(name) @received_amount = BigDecimal.new(amount) end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
15 16 17 |
# File 'lib/coinsync/importers/changelly.rb', line 15 def date @date end |
#exchanged_amount ⇒ Object
Returns the value of attribute exchanged_amount.
15 16 17 |
# File 'lib/coinsync/importers/changelly.rb', line 15 def exchanged_amount @exchanged_amount end |
#exchanged_currency ⇒ Object
Returns the value of attribute exchanged_currency.
15 16 17 |
# File 'lib/coinsync/importers/changelly.rb', line 15 def exchanged_currency @exchanged_currency end |
#received_amount ⇒ Object
Returns the value of attribute received_amount.
15 16 17 |
# File 'lib/coinsync/importers/changelly.rb', line 15 def received_amount @received_amount end |
#received_currency ⇒ Object
Returns the value of attribute received_currency.
15 16 17 |
# File 'lib/coinsync/importers/changelly.rb', line 15 def received_currency @received_currency end |
#status ⇒ Object
Returns the value of attribute status.
15 16 17 |
# File 'lib/coinsync/importers/changelly.rb', line 15 def status @status end |