# File lib/typhoeus/hydra/connect_options.rb, line 23 def self.extended(base) class << base attr_accessor :allow_net_connect attr_accessor :ignore_localhost end base.allow_net_connect = true base.ignore_localhost = false end
Returns whether we allow external HTTP connections. Useful for mocking/tests.
@return [boolean] true/false
# File lib/typhoeus/hydra/connect_options.rb, line 36 def allow_net_connect? allow_net_connect end
# File lib/typhoeus/hydra/connect_options.rb, line 44 def ignore_hosts @ignore_hosts ||= [] if ignore_localhost? @ignore_hosts + Typhoeus::Request::LOCALHOST_ALIASES else @ignore_hosts end end
# File lib/typhoeus/hydra/connect_options.rb, line 54 def ignore_hosts=(hosts) @ignore_hosts = hosts end
# File lib/typhoeus/hydra/connect_options.rb, line 40 def ignore_localhost? ignore_localhost end