Class: CoinSync::Importers::KucoinAPI::HistoryEntry

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#amountObject

Returns the value of attribute amount.



22
23
24
# File 'lib/coinsync/importers/kucoin_api.rb', line 22

def amount
  @amount
end

#coin_typeObject

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_pairObject

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_atObject

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_valueObject

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

#directionObject

Returns the value of attribute direction.



22
23
24
# File 'lib/coinsync/importers/kucoin_api.rb', line 22

def direction
  @direction
end

#feeObject

Returns the value of attribute fee.



22
23
24
# File 'lib/coinsync/importers/kucoin_api.rb', line 22

def fee
  @fee
end