Class: MarketBot::Util
- Inherits:
-
Object
- Object
- MarketBot::Util
- Defined in:
- lib/market_bot/util.rb
Class Method Summary collapse
Class Method Details
.build_request_opts(opts) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/market_bot/util.rb', line 7 def self.build_request_opts(opts) opts ||= {} opts[:timeout] ||= MarketBot.timeout opts[:connecttimeout] ||= MarketBot.connect_timeout opts[:headers] ||= {} opts[:headers]['User-Agent'] ||= MarketBot.user_agent opts end |
.fix_content_url(url) ⇒ Object
3 4 5 |
# File 'lib/market_bot/util.rb', line 3 def self.fix_content_url(url) url =~ /\A\/\// ? "https:#{url}" : url end |