Class: CoinSync::Importers::KucoinAPI::HistoryEntry
- Inherits:
-
Object
- Object
- CoinSync::Importers::KucoinAPI::HistoryEntry
- Defined in:
- lib/coinsync/importers/kucoin_api.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#coin_type ⇒ Object
Returns the value of attribute coin_type.
-
#coin_type_pair ⇒ Object
Returns the value of attribute coin_type_pair.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#deal_value ⇒ Object
Returns the value of attribute deal_value.
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#fee ⇒ Object
Returns the value of attribute fee.
Instance Method Summary collapse
-
#initialize(hash) ⇒ HistoryEntry
constructor
A new instance of HistoryEntry.
Constructor Details
#initialize(hash) ⇒ HistoryEntry
Returns a new instance of HistoryEntry.
24 25 26 27 28 29 30 31 32 |
# File 'lib/coinsync/importers/kucoin_api.rb', line 24 def initialize(hash) @created_at = Time.at(hash['createdAt'] / 1000) @amount = BigDecimal.new(hash['amount'], 0) @direction = hash['direction'] @coin_type = CryptoCurrency.new(hash['coinType']) @coin_type_pair = CryptoCurrency.new(hash['coinTypePair']) @deal_value = BigDecimal.new(hash['dealValue'], 0) @fee = BigDecimal.new(hash['fee'], 0) end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
22 23 24 |
# File 'lib/coinsync/importers/kucoin_api.rb', line 22 def amount @amount end |
#coin_type ⇒ Object
Returns the value of attribute coin_type.
22 23 24 |
# File 'lib/coinsync/importers/kucoin_api.rb', line 22 def coin_type @coin_type end |
#coin_type_pair ⇒ Object
Returns the value of attribute coin_type_pair.
22 23 24 |
# File 'lib/coinsync/importers/kucoin_api.rb', line 22 def coin_type_pair @coin_type_pair end |
#created_at ⇒ Object
Returns the value of attribute created_at.
22 23 24 |
# File 'lib/coinsync/importers/kucoin_api.rb', line 22 def created_at @created_at end |
#deal_value ⇒ Object
Returns the value of attribute deal_value.
22 23 24 |
# File 'lib/coinsync/importers/kucoin_api.rb', line 22 def deal_value @deal_value end |
#direction ⇒ Object
Returns the value of attribute direction.
22 23 24 |
# File 'lib/coinsync/importers/kucoin_api.rb', line 22 def direction @direction end |
#fee ⇒ Object
Returns the value of attribute fee.
22 23 24 |
# File 'lib/coinsync/importers/kucoin_api.rb', line 22 def fee @fee end |