Class: ItBitSDK::Trade

Inherits:
Object
  • Object
show all
Defined in:
lib/it_bit_sdk/domain/trade.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params:) ⇒ Trade

Returns a new instance of Trade.



5
6
7
8
9
10
# File 'lib/it_bit_sdk/domain/trade.rb', line 5

def initialize(params:)
  @timestamp    = Time.parse(params['timestamp'])
  @match_number = params['matchNumber']
  @price        = params['price'].to_f
  @amount       = params['amount'].to_f
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



3
4
5
# File 'lib/it_bit_sdk/domain/trade.rb', line 3

def amount
  @amount
end

#match_numberObject

Returns the value of attribute match_number.



3
4
5
# File 'lib/it_bit_sdk/domain/trade.rb', line 3

def match_number
  @match_number
end

#priceObject

Returns the value of attribute price.



3
4
5
# File 'lib/it_bit_sdk/domain/trade.rb', line 3

def price
  @price
end

#timestampObject

Returns the value of attribute timestamp.



3
4
5
# File 'lib/it_bit_sdk/domain/trade.rb', line 3

def timestamp
  @timestamp
end