Class: Watchcow::MarketDepth
- Inherits:
-
Object
- Object
- Watchcow::MarketDepth
- Defined in:
- lib/watchcow/market_depth.rb
Constant Summary collapse
- URLDM =
"https://api.hbdm.com/market/depth"- URLPRO =
"https://api.huobi.pro/market/depth"
Class Method Summary collapse
-
.call(params:, k:) ⇒ Object
Spot market or Futures market all goes here.
- .prepared_params(params, k) ⇒ Object
- .target_url(params, k) ⇒ Object
Class Method Details
.call(params:, k:) ⇒ Object
Spot market or Futures market all goes here
9 10 11 12 |
# File 'lib/watchcow/market_depth.rb', line 9 def call(params:, k:) url = target_url(params, k) HTTParty.get(url) end |
.prepared_params(params, k) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/watchcow/market_depth.rb', line 14 def prepared_params(params, k) return '' if params.nil? step = if k == :future "&type=step6" else "&type=step2" end arr = [] params.each_pair do |k,v| arr.push "#{k}=#{v}" end return "#{arr.join('&')}#{step}" end |