Class: Bitcoin::Ssymbol
- Inherits:
-
Object
- Object
- Bitcoin::Ssymbol
- Defined in:
- lib/bitcoin/ssymbol.rb
Instance Attribute Summary collapse
-
#baseCurrency ⇒ Object
Returns the value of attribute baseCurrency.
-
#feeCurrency ⇒ Object
Returns the value of attribute feeCurrency.
-
#id ⇒ Object
Returns the value of attribute id.
-
#provideLiquidityRate ⇒ Object
Returns the value of attribute provideLiquidityRate.
-
#quantityIncrement ⇒ Object
Returns the value of attribute quantityIncrement.
-
#quoteCurrency ⇒ Object
Returns the value of attribute quoteCurrency.
-
#takeLiquidityRate ⇒ Object
Returns the value of attribute takeLiquidityRate.
-
#tickSize ⇒ Object
Returns the value of attribute tickSize.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#baseCurrency ⇒ Object
Returns the value of attribute baseCurrency.
3 4 5 |
# File 'lib/bitcoin/ssymbol.rb', line 3 def baseCurrency @baseCurrency end |
#feeCurrency ⇒ Object
Returns the value of attribute feeCurrency.
3 4 5 |
# File 'lib/bitcoin/ssymbol.rb', line 3 def feeCurrency @feeCurrency end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/bitcoin/ssymbol.rb', line 3 def id @id end |
#provideLiquidityRate ⇒ Object
Returns the value of attribute provideLiquidityRate.
3 4 5 |
# File 'lib/bitcoin/ssymbol.rb', line 3 def provideLiquidityRate @provideLiquidityRate end |
#quantityIncrement ⇒ Object
Returns the value of attribute quantityIncrement.
3 4 5 |
# File 'lib/bitcoin/ssymbol.rb', line 3 def quantityIncrement @quantityIncrement end |
#quoteCurrency ⇒ Object
Returns the value of attribute quoteCurrency.
3 4 5 |
# File 'lib/bitcoin/ssymbol.rb', line 3 def quoteCurrency @quoteCurrency end |
#takeLiquidityRate ⇒ Object
Returns the value of attribute takeLiquidityRate.
3 4 5 |
# File 'lib/bitcoin/ssymbol.rb', line 3 def takeLiquidityRate @takeLiquidityRate end |
#tickSize ⇒ Object
Returns the value of attribute tickSize.
3 4 5 |
# File 'lib/bitcoin/ssymbol.rb', line 3 def tickSize @tickSize end |
Class Method Details
.all ⇒ Object
29 30 31 32 33 34 |
# File 'lib/bitcoin/ssymbol.rb', line 29 def self.all data = JSON.parse(RestClient.get("#{Bitcoin::BASE}/public/symbol")) data.map{ |ssymbol| Bitcoin::Ssymbol.new_from_object(ssymbol) } end |
.new_from_object(data) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/bitcoin/ssymbol.rb', line 16 def self.new_from_object(data) s = Bitcoin::Ssymbol.new s.id = data['id'] s.baseCurrency = data['baseCurrency'] s.quoteCurrency = data['quoteCurrency'] s.quantityIncrement = data['quantityIncrement'] s.tickSize = data['tickSize'] s.takeLiquidityRate = data['takeLiquidityRate'] s.provideLiquidityRate = data['provideLiquidityRate'] s.feeCurrency = data['feeCurrency'] s end |
.new_from_symbol_name(symbol_name) ⇒ Object
36 37 38 39 |
# File 'lib/bitcoin/ssymbol.rb', line 36 def self.new_from_symbol_name(symbol_name) data = JSON.parse(RestClient.get("#{Bitcoin::BASE}/public/symbol/#{symbol_name}")) Bitcoin::Ssymbol.new_from_object(data) end |
Instance Method Details
#display_details ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/bitcoin/ssymbol.rb', line 5 def display_details puts <<-DOC ID: #{@id} Base Currency: #{@baseCurrency} || Quote Currency: #{@quoteCurrency} Quantity Increment: #{@quantityIncrement} || Tick Size: #{@tickSize} Take Liquidity Rate: #{@takeLiquidityRate} || Provide Liquidity Rate: #{@provideLiquidityRate} Fee Currency: #{@feeCurrency} DOC end |