Class: CoinSync::Importers::BitstampCSV::HistoryEntry

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#amountObject

Returns the value of attribute amount.



15
16
17
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15

def amount
  @amount
end

#dateObject

Returns the value of attribute date.



15
16
17
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15

def date
  @date
end

#feeObject

Returns the value of attribute fee.



15
16
17
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15

def fee
  @fee
end

#fee_currencyObject

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

#idObject

Returns the value of attribute id.



15
16
17
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15

def id
  @id
end

#lpObject

Returns the value of attribute lp.



15
16
17
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15

def lp
  @lp
end

#marketObject

Returns the value of attribute market.



15
16
17
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15

def market
  @market
end

#priceObject

Returns the value of attribute price.



15
16
17
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15

def price
  @price
end

#totalObject

Returns the value of attribute total.



15
16
17
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15

def total
  @total
end

#typeObject

Returns the value of attribute type.



15
16
17
# File 'lib/coinsync/importers/bitstamp_csv.rb', line 15

def type
  @type
end