Class: CoinSync::Importers::BittrexCSV::HistoryEntry
- Inherits:
-
Object
- Object
- CoinSync::Importers::BittrexCSV::HistoryEntry
- Defined in:
- lib/coinsync/importers/bittrex_csv.rb
Constant Summary collapse
- TIME_FORMAT =
'%m/%d/%Y %H:%M:%S %p %z'
Instance Attribute Summary collapse
-
#asset ⇒ Object
Returns the value of attribute asset.
-
#commission ⇒ Object
Returns the value of attribute commission.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#price ⇒ Object
Returns the value of attribute price.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#time_closed ⇒ Object
Returns the value of attribute time_closed.
-
#time_opened ⇒ Object
Returns the value of attribute time_opened.
-
#type ⇒ Object
Returns the value of attribute type.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
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 |
# File 'lib/coinsync/importers/bittrex_csv.rb', line 20 def initialize(line) @uuid = line[0] @currency, @asset = line[1].split('-').map { |c| CryptoCurrency.new(c) } @type = line[2] @quantity = BigDecimal.new(line[3]) @limit = BigDecimal.new(line[4]) @commission = BigDecimal.new(line[5]) @price = BigDecimal.new(line[6]) @time_opened = Time.strptime(line[7] + ' +0000', TIME_FORMAT) @time_closed = Time.strptime(line[8] + ' +0000', TIME_FORMAT) end |
Instance Attribute Details
#asset ⇒ Object
Returns the value of attribute asset.
17 18 19 |
# File 'lib/coinsync/importers/bittrex_csv.rb', line 17 def asset @asset end |
#commission ⇒ Object
Returns the value of attribute commission.
17 18 19 |
# File 'lib/coinsync/importers/bittrex_csv.rb', line 17 def commission @commission end |
#currency ⇒ Object
Returns the value of attribute currency.
17 18 19 |
# File 'lib/coinsync/importers/bittrex_csv.rb', line 17 def currency @currency end |
#limit ⇒ Object
Returns the value of attribute limit.
17 18 19 |
# File 'lib/coinsync/importers/bittrex_csv.rb', line 17 def limit @limit end |
#price ⇒ Object
Returns the value of attribute price.
17 18 19 |
# File 'lib/coinsync/importers/bittrex_csv.rb', line 17 def price @price end |
#quantity ⇒ Object
Returns the value of attribute quantity.
17 18 19 |
# File 'lib/coinsync/importers/bittrex_csv.rb', line 17 def quantity @quantity end |
#time_closed ⇒ Object
Returns the value of attribute time_closed.
17 18 19 |
# File 'lib/coinsync/importers/bittrex_csv.rb', line 17 def time_closed @time_closed end |
#time_opened ⇒ Object
Returns the value of attribute time_opened.
17 18 19 |
# File 'lib/coinsync/importers/bittrex_csv.rb', line 17 def time_opened @time_opened end |
#type ⇒ Object
Returns the value of attribute type.
17 18 19 |
# File 'lib/coinsync/importers/bittrex_csv.rb', line 17 def type @type end |
#uuid ⇒ Object
Returns the value of attribute uuid.
17 18 19 |
# File 'lib/coinsync/importers/bittrex_csv.rb', line 17 def uuid @uuid end |