Class: Buda::Market

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

Overview

for handling the total balance

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, base_currency:, quote_currency:, minimum_order_amount:) ⇒ Market

Returns a new instance of Market.



10
11
12
13
14
15
16
# File 'lib/buda/resources/market.rb', line 10

def initialize(id:, name:, base_currency:, quote_currency:, minimum_order_amount:, **)
  @id = id
  @name = name
  @base_currency = base_currency
  @quote_currency = quote_currency
  @minimum_order_amount = minimum_order_amount
end

Instance Attribute Details

#base_currencyObject (readonly)

Returns the value of attribute base_currency.



8
9
10
# File 'lib/buda/resources/market.rb', line 8

def base_currency
  @base_currency
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/buda/resources/market.rb', line 8

def id
  @id
end

#minimum_order_amountObject (readonly)

Returns the value of attribute minimum_order_amount.



8
9
10
# File 'lib/buda/resources/market.rb', line 8

def minimum_order_amount
  @minimum_order_amount
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/buda/resources/market.rb', line 8

def name
  @name
end

#quote_currencyObject (readonly)

Returns the value of attribute quote_currency.



8
9
10
# File 'lib/buda/resources/market.rb', line 8

def quote_currency
  @quote_currency
end

#tickerObject (readonly)

Returns the value of attribute ticker.



8
9
10
# File 'lib/buda/resources/market.rb', line 8

def ticker
  @ticker
end

Instance Method Details

#inspectObject



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

def inspect
  "<Market #{@name} (#{@id})>"
end

#set_ticker(**ticker) ⇒ Object



18
19
20
# File 'lib/buda/resources/market.rb', line 18

def set_ticker(**ticker)
  @ticker = Buda::Ticker.new(**ticker)
end

#to_sObject



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

def to_s
  "#{@name} (#{@id})"
end