Module: Naming
- Defined in:
- lib/deribit/naming.rb
Class Method Summary collapse
- .book_channel(options) ⇒ Object
- .cancel_uri(options) ⇒ Object
- .channel(prefix, options) ⇒ Object
- .channel_for_instrument(prefix, options) ⇒ Object
- .instrument_with_interval(prefix, options) ⇒ Object
- .trades_channel(options) ⇒ Object
- .trades_uri(options) ⇒ Object
Class Method Details
.book_channel(options) ⇒ Object
18 19 20 |
# File 'lib/deribit/naming.rb', line 18 def self.book_channel() 'book' + for_instrument() + with_group_and_depth() + with_interval() end |
.cancel_uri(options) ⇒ Object
34 35 36 |
# File 'lib/deribit/naming.rb', line 34 def self.cancel_uri() "/private/cancel_all" + by_instrument() + by_currency() end |
.channel(prefix, options) ⇒ Object
22 23 24 |
# File 'lib/deribit/naming.rb', line 22 def self.channel(prefix, ) prefix + channel_suffix() end |
.channel_for_instrument(prefix, options) ⇒ Object
26 27 28 |
# File 'lib/deribit/naming.rb', line 26 def self.channel_for_instrument(prefix, ) prefix + for_instrument() end |
.instrument_with_interval(prefix, options) ⇒ Object
30 31 32 |
# File 'lib/deribit/naming.rb', line 30 def self.instrument_with_interval(prefix, ) prefix + for_instrument() + with_interval() end |
.trades_channel(options) ⇒ Object
4 5 6 7 8 |
# File 'lib/deribit/naming.rb', line 4 def self.trades_channel() private = .delete :private trades = private ? 'user.trades' : 'trades' channel trades, end |
.trades_uri(options) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/deribit/naming.rb', line 10 def self.trades_uri() private = .delete :private uri = private ? 'private/get_user_trades' : 'public/get_last_trades' uri += [:instrument_name] ? '_by_instrument' : '_by_currency' uri += [:end_timestamp] ? '_and_time' : '' uri end |