Class: CoinSync::Importers::Bitcurex::HistoryEntry
- Inherits:
-
Object
- Object
- CoinSync::Importers::Bitcurex::HistoryEntry
- Defined in:
- lib/coinsync/importers/bitcurex.rb
Constant Summary collapse
- POLISH_TIMEZONE =
TZInfo::Timezone.get('Europe/Warsaw')
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.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/coinsync/importers/bitcurex.rb', line 20 def initialize(line) @lp = line[0].to_i @type = line[1] @date = POLISH_TIMEZONE.local_to_utc(Time.parse(line[2])) @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.
16 17 18 |
# File 'lib/coinsync/importers/bitcurex.rb', line 16 def amount @amount end |
#date ⇒ Object
Returns the value of attribute date.
16 17 18 |
# File 'lib/coinsync/importers/bitcurex.rb', line 16 def date @date end |
#fee ⇒ Object
Returns the value of attribute fee.
16 17 18 |
# File 'lib/coinsync/importers/bitcurex.rb', line 16 def fee @fee end |
#fee_currency ⇒ Object
Returns the value of attribute fee_currency.
16 17 18 |
# File 'lib/coinsync/importers/bitcurex.rb', line 16 def fee_currency @fee_currency end |
#id ⇒ Object
Returns the value of attribute id.
16 17 18 |
# File 'lib/coinsync/importers/bitcurex.rb', line 16 def id @id end |
#lp ⇒ Object
Returns the value of attribute lp.
16 17 18 |
# File 'lib/coinsync/importers/bitcurex.rb', line 16 def lp @lp end |
#market ⇒ Object
Returns the value of attribute market.
16 17 18 |
# File 'lib/coinsync/importers/bitcurex.rb', line 16 def market @market end |
#price ⇒ Object
Returns the value of attribute price.
16 17 18 |
# File 'lib/coinsync/importers/bitcurex.rb', line 16 def price @price end |
#total ⇒ Object
Returns the value of attribute total.
16 17 18 |
# File 'lib/coinsync/importers/bitcurex.rb', line 16 def total @total end |
#type ⇒ Object
Returns the value of attribute type.
16 17 18 |
# File 'lib/coinsync/importers/bitcurex.rb', line 16 def type @type end |