Class: CoinSync::Importers::Bitcurex::HistoryEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/coinsync/importers/bitcurex.rb

Constant Summary collapse

POLISH_TIMEZONE =
TZInfo::Timezone.get('Europe/Warsaw')

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#amountObject

Returns the value of attribute amount.



16
17
18
# File 'lib/coinsync/importers/bitcurex.rb', line 16

def amount
  @amount
end

#dateObject

Returns the value of attribute date.



16
17
18
# File 'lib/coinsync/importers/bitcurex.rb', line 16

def date
  @date
end

#feeObject

Returns the value of attribute fee.



16
17
18
# File 'lib/coinsync/importers/bitcurex.rb', line 16

def fee
  @fee
end

#fee_currencyObject

Returns the value of attribute fee_currency.



16
17
18
# File 'lib/coinsync/importers/bitcurex.rb', line 16

def fee_currency
  @fee_currency
end

#idObject

Returns the value of attribute id.



16
17
18
# File 'lib/coinsync/importers/bitcurex.rb', line 16

def id
  @id
end

#lpObject

Returns the value of attribute lp.



16
17
18
# File 'lib/coinsync/importers/bitcurex.rb', line 16

def lp
  @lp
end

#marketObject

Returns the value of attribute market.



16
17
18
# File 'lib/coinsync/importers/bitcurex.rb', line 16

def market
  @market
end

#priceObject

Returns the value of attribute price.



16
17
18
# File 'lib/coinsync/importers/bitcurex.rb', line 16

def price
  @price
end

#totalObject

Returns the value of attribute total.



16
17
18
# File 'lib/coinsync/importers/bitcurex.rb', line 16

def total
  @total
end

#typeObject

Returns the value of attribute type.



16
17
18
# File 'lib/coinsync/importers/bitcurex.rb', line 16

def type
  @type
end