Typhoeus::Hydra::ConnectOptions::ClassMethods

Public Class Methods

extended(base) click to toggle source
# 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

Public Instance Methods

allow_net_connect?() click to toggle source

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
ignore_hosts() click to toggle source
# 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
ignore_hosts=(hosts) click to toggle source
# File lib/typhoeus/hydra/connect_options.rb, line 54
def ignore_hosts=(hosts)
  @ignore_hosts = hosts
end
ignore_localhost?() click to toggle source
# File lib/typhoeus/hydra/connect_options.rb, line 40
def ignore_localhost?
  ignore_localhost
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.