Class: Buda::Ticker

Inherits:
Object
  • Object
show all
Defined in:
lib/buda/resources/ticker.rb

Overview

for handling the total balance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(market_id:, last_price:, min_ask:, max_bid:, volume:, price_variation_24h:, price_variation_7d:) ⇒ Ticker

Returns a new instance of Ticker.



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/buda/resources/ticker.rb', line 9

def initialize(market_id:,
               last_price:, min_ask:,
               max_bid:, volume:,
               price_variation_24h:, price_variation_7d:, **)
  @market_id = market_id
  @last_price = last_price[0]
  @min_ask = min_ask
  @max_bid = max_bid
  @price_variation_24h = price_variation_24h
  @volume = volume
  @price_variation_7d = price_variation_7d
end

Instance Attribute Details

#last_priceObject (readonly)

Returns the value of attribute last_price.



6
7
8
# File 'lib/buda/resources/ticker.rb', line 6

def last_price
  @last_price
end

#market_idObject (readonly)

Returns the value of attribute market_id.



6
7
8
# File 'lib/buda/resources/ticker.rb', line 6

def market_id
  @market_id
end

#max_bidObject (readonly)

Returns the value of attribute max_bid.



6
7
8
# File 'lib/buda/resources/ticker.rb', line 6

def max_bid
  @max_bid
end

#min_askObject (readonly)

Returns the value of attribute min_ask.



6
7
8
# File 'lib/buda/resources/ticker.rb', line 6

def min_ask
  @min_ask
end

#price_variation_24hObject (readonly)

Returns the value of attribute price_variation_24h.



6
7
8
# File 'lib/buda/resources/ticker.rb', line 6

def price_variation_24h
  @price_variation_24h
end

#price_variation_7dObject (readonly)

Returns the value of attribute price_variation_7d.



6
7
8
# File 'lib/buda/resources/ticker.rb', line 6

def price_variation_7d
  @price_variation_7d
end

#volumeObject (readonly)

Returns the value of attribute volume.



6
7
8
# File 'lib/buda/resources/ticker.rb', line 6

def volume
  @volume
end

Instance Method Details

#inspectObject



26
27
28
# File 'lib/buda/resources/ticker.rb', line 26

def inspect
  "<Ticker #{@market_id} (#{@last_price})>"
end

#to_sObject



22
23
24
# File 'lib/buda/resources/ticker.rb', line 22

def to_s
  "#{@market_id} (#{@last_price})"
end