Class: CoinSync::Importers::BitstampCSV::HistoryEntry
- Inherits:
-
Object
- Object
- CoinSync::Importers::BitstampCSV::HistoryEntry
- Defined in:
- lib/coinsync/importers/bitstamp_csv.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_currency ⇒ Object
Returns the value of attribute fee_currency.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lp ⇒ Object
Returns the value of attribute lp.
-
#market ⇒ Object
Returns the value of attribute market.
-
#price ⇒ Object
Returns the value of attribute price.
-
#total ⇒ Object
Returns the value of attribute total.
-
#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.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 17 def initialize(line) @type = line[0] @date = Time.parse(line[1]) @account = line[2] @lp = line[0].to_i @market = FiatCurrency.new(line[3]) @amount = BigDecimal.new(line[4]) @price = BigDecimal.new(line[5].split(' ').first) @total = BigDecimal.new(line[6].split(' ').first) @fee = BigDecimal.new(line[7].split(' ').first) @fee_currency = line[7].split(' ').last @id = line[8].to_i end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
15 16 17 |
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15 def amount @amount end |
#date ⇒ Object
Returns the value of attribute date.
15 16 17 |
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15 def date @date end |
#fee ⇒ Object
Returns the value of attribute fee.
15 16 17 |
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15 def fee @fee end |
#fee_currency ⇒ Object
Returns the value of attribute fee_currency.
15 16 17 |
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15 def fee_currency @fee_currency end |
#id ⇒ Object
Returns the value of attribute id.
15 16 17 |
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15 def id @id end |
#lp ⇒ Object
Returns the value of attribute lp.
15 16 17 |
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15 def lp @lp end |
#market ⇒ Object
Returns the value of attribute market.
15 16 17 |
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15 def market @market end |
#price ⇒ Object
Returns the value of attribute price.
15 16 17 |
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15 def price @price end |
#total ⇒ Object
Returns the value of attribute total.
15 16 17 |
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15 def total @total end |
#type ⇒ Object
Returns the value of attribute type.
15 16 17 |
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15 def type @type end |