Class: Flashboy::Client
- Inherits:
-
Object
- Object
- Flashboy::Client
- Defined in:
- lib/flashboy/client.rb
Direct Known Subclasses
Class Method Summary collapse
- .docs(docs = nil) ⇒ Object
- .host(host = nil) ⇒ Object
- .key ⇒ Object
- .name(name = nil) ⇒ Object
- .order_book_path(pair = nil, &path) ⇒ Object
- .quote_path(pair = nil, &path) ⇒ Object
- .trades_path(pair = nil, params = {}, &path) ⇒ Object
Instance Method Summary collapse
- #docs ⇒ Object
- #host ⇒ Object
- #key ⇒ Object
- #name ⇒ Object
- #order_book_path(pair) ⇒ Object
- #quote_path(pair) ⇒ Object
- #trades_path(pair, params = {}) ⇒ Object
Class Method Details
.docs(docs = nil) ⇒ Object
20 21 22 23 |
# File 'lib/flashboy/client.rb', line 20 def self.docs(docs = nil) return @docs if docs.nil? @docs = docs end |
.host(host = nil) ⇒ Object
29 30 31 32 |
# File 'lib/flashboy/client.rb', line 29 def self.host(host = nil) return @host if host.nil? @host = host end |
.key ⇒ Object
12 13 14 |
# File 'lib/flashboy/client.rb', line 12 def self.key @name.to_s.downcase.gsub(' ', '_').to_sym end |
.name(name = nil) ⇒ Object
3 4 5 6 |
# File 'lib/flashboy/client.rb', line 3 def self.name(name = nil) return @name if name.nil? @name = name end |
.order_book_path(pair = nil, &path) ⇒ Object
60 61 62 63 |
# File 'lib/flashboy/client.rb', line 60 def self.order_book_path(pair = nil, &path) return @order_book_path.call(pair) unless block_given? @order_book_path = path end |
.quote_path(pair = nil, &path) ⇒ Object
38 39 40 41 |
# File 'lib/flashboy/client.rb', line 38 def self.quote_path(pair = nil, &path) return @quote_path.call(pair) unless block_given? @quote_path = path end |
.trades_path(pair = nil, params = {}, &path) ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/flashboy/client.rb', line 47 def self.trades_path(pair = nil, params = {}, &path) if !block_given? raise RuntimeError, "You must define the trades_path on your exchange" if @trades_path.nil? return @trades_path.call(pair, params) end @trades_path = path end |
Instance Method Details
#docs ⇒ Object
25 26 27 |
# File 'lib/flashboy/client.rb', line 25 def docs self.class.docs end |
#host ⇒ Object
34 35 36 |
# File 'lib/flashboy/client.rb', line 34 def host self.class.host end |
#key ⇒ Object
16 17 18 |
# File 'lib/flashboy/client.rb', line 16 def key self.class.key end |
#name ⇒ Object
8 9 10 |
# File 'lib/flashboy/client.rb', line 8 def name self.class.name end |
#order_book_path(pair) ⇒ Object
65 66 67 |
# File 'lib/flashboy/client.rb', line 65 def order_book_path(pair) self.class.order_book_path(pair) end |
#quote_path(pair) ⇒ Object
43 44 45 |
# File 'lib/flashboy/client.rb', line 43 def quote_path(pair) self.class.quote_path(pair) end |
#trades_path(pair, params = {}) ⇒ Object
56 57 58 |
# File 'lib/flashboy/client.rb', line 56 def trades_path(pair, params = {}) self.class.trades_path(pair, params) end |