Class: CoinSync::Importers::Circle::HistoryEntry
- Inherits:
-
Object
- Object
- CoinSync::Importers::Circle::HistoryEntry
- Defined in:
- lib/coinsync/importers/circle.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#from_account ⇒ Object
Returns the value of attribute from_account.
-
#from_amount ⇒ Object
Returns the value of attribute from_amount.
-
#from_currency ⇒ Object
Returns the value of attribute from_currency.
-
#id ⇒ Object
Returns the value of attribute id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#to_account ⇒ Object
Returns the value of attribute to_account.
-
#to_amount ⇒ Object
Returns the value of attribute to_amount.
-
#to_currency ⇒ Object
Returns the value of attribute to_currency.
-
#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.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/coinsync/importers/circle.rb', line 18 def initialize(line) @date = Time.strptime(line[0], '%a %b %d %Y %H:%M:%S GMT+0000 (%Z)') @id = line[1] @type = line[2] @from_account = line[3] @to_account = line[4] @from_amount = BigDecimal.new(line[5].gsub(/[^\d\.]+/, '')) @from_currency = FiatCurrency.new(line[6]) @to_amount = BigDecimal.new(line[7].gsub(/[^\d\.]+/, '')) @to_currency = CryptoCurrency.new(line[8]) @status = line[9] end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
15 16 17 |
# File 'lib/coinsync/importers/circle.rb', line 15 def date @date end |
#from_account ⇒ Object
Returns the value of attribute from_account.
15 16 17 |
# File 'lib/coinsync/importers/circle.rb', line 15 def from_account @from_account end |
#from_amount ⇒ Object
Returns the value of attribute from_amount.
15 16 17 |
# File 'lib/coinsync/importers/circle.rb', line 15 def from_amount @from_amount end |
#from_currency ⇒ Object
Returns the value of attribute from_currency.
15 16 17 |
# File 'lib/coinsync/importers/circle.rb', line 15 def from_currency @from_currency end |
#id ⇒ Object
Returns the value of attribute id.
15 16 17 |
# File 'lib/coinsync/importers/circle.rb', line 15 def id @id end |
#status ⇒ Object
Returns the value of attribute status.
15 16 17 |
# File 'lib/coinsync/importers/circle.rb', line 15 def status @status end |
#to_account ⇒ Object
Returns the value of attribute to_account.
15 16 17 |
# File 'lib/coinsync/importers/circle.rb', line 15 def to_account @to_account end |
#to_amount ⇒ Object
Returns the value of attribute to_amount.
15 16 17 |
# File 'lib/coinsync/importers/circle.rb', line 15 def to_amount @to_amount end |
#to_currency ⇒ Object
Returns the value of attribute to_currency.
15 16 17 |
# File 'lib/coinsync/importers/circle.rb', line 15 def to_currency @to_currency end |
#type ⇒ Object
Returns the value of attribute type.
15 16 17 |
# File 'lib/coinsync/importers/circle.rb', line 15 def type @type end |