Class: CoinSync::Importers::EtherDelta::HistoryEntry
- Inherits:
-
Object
- Object
- CoinSync::Importers::EtherDelta::HistoryEntry
- Defined in:
- lib/coinsync/importers/etherdelta.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#date ⇒ Object
Returns the value of attribute date.
-
#fee ⇒ Object
Returns the value of attribute fee.
-
#fee_token ⇒ Object
Returns the value of attribute fee_token.
-
#price ⇒ Object
Returns the value of attribute price.
-
#token ⇒ Object
Returns the value of attribute token.
-
#total ⇒ Object
Returns the value of attribute total.
-
#trade ⇒ Object
Returns the value of attribute trade.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(line) ⇒ HistoryEntry
constructor
A new instance of HistoryEntry.
Constructor Details
#initialize(line) ⇒ HistoryEntry
Returns a new instance of HistoryEntry.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/coinsync/importers/etherdelta.rb', line 22 def initialize(line) @type = line[0] if !['Maker', 'Taker'].include?(@type) raise "EtherDelta importer: incorrect csv format - unexpected '#{@type}' in the first column" end @trade = line[1] if !['Buy', 'Sell'].include?(@trade) raise "EtherDelta importer: incorrect csv format - unexpected '#{@trade}' in the second column" end @token = CryptoCurrency.new(line[2]) @amount = BigDecimal.new(line[3]) @price = BigDecimal.new(line[4]) @total = BigDecimal.new(line[5]) @date = Time.parse(line[6]) @fee = BigDecimal.new(line[11]) @fee_token = CryptoCurrency.new(line[12]) end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
20 21 22 |
# File 'lib/coinsync/importers/etherdelta.rb', line 20 def amount @amount end |
#date ⇒ Object
Returns the value of attribute date.
20 21 22 |
# File 'lib/coinsync/importers/etherdelta.rb', line 20 def date @date end |
#fee ⇒ Object
Returns the value of attribute fee.
20 21 22 |
# File 'lib/coinsync/importers/etherdelta.rb', line 20 def fee @fee end |
#fee_token ⇒ Object
Returns the value of attribute fee_token.
20 21 22 |
# File 'lib/coinsync/importers/etherdelta.rb', line 20 def fee_token @fee_token end |
#price ⇒ Object
Returns the value of attribute price.
20 21 22 |
# File 'lib/coinsync/importers/etherdelta.rb', line 20 def price @price end |
#token ⇒ Object
Returns the value of attribute token.
20 21 22 |
# File 'lib/coinsync/importers/etherdelta.rb', line 20 def token @token end |
#total ⇒ Object
Returns the value of attribute total.
20 21 22 |
# File 'lib/coinsync/importers/etherdelta.rb', line 20 def total @total end |
#trade ⇒ Object
Returns the value of attribute trade.
20 21 22 |
# File 'lib/coinsync/importers/etherdelta.rb', line 20 def trade @trade end |
#type ⇒ Object
Returns the value of attribute type.
20 21 22 |
# File 'lib/coinsync/importers/etherdelta.rb', line 20 def type @type end |