Class: UrlResolver::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/url_resolver/configuration.rb

Constant Summary collapse

DEFAULT_ERRORS_TO_IGNORE =
[SocketError,
Errno::ETIMEDOUT,
Errno::ECONNREFUSED,
Errno::ECONNRESET,
RestClient::InternalServerError,
RestClient::ServiceUnavailable,
RestClient::BadRequest,
RestClient::GatewayTimeout,
RestClient::RequestTimeout,
RestClient::ResourceNotFound,
RestClient::BadGateway,
RestClient::MethodNotAllowed,
RestClient::Unauthorized,
RestClient::Forbidden,
RestClient::NotAcceptable,
URI::InvalidURIError]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



23
24
25
26
27
28
29
# File 'lib/url_resolver/configuration.rb', line 23

def initialize
  @cache_failures = true
  @cache = nil
  @url_cache = Cache.new(@cache)
  @user_agent = 'Ruby'
  @errors_to_ignore = DEFAULT_ERRORS_TO_IGNORE
end

Instance Attribute Details

#cacheObject

Returns the value of attribute cache.



4
5
6
# File 'lib/url_resolver/configuration.rb', line 4

def cache
  @cache
end

#cache_failuresObject

Returns the value of attribute cache_failures.



3
4
5
# File 'lib/url_resolver/configuration.rb', line 3

def cache_failures
  @cache_failures
end

#errors_to_ignoreObject

Returns the value of attribute errors_to_ignore.



3
4
5
# File 'lib/url_resolver/configuration.rb', line 3

def errors_to_ignore
  @errors_to_ignore
end

#url_cacheObject (readonly)

Returns the value of attribute url_cache.



4
5
6
# File 'lib/url_resolver/configuration.rb', line 4

def url_cache
  @url_cache
end

#user_agentObject

Returns the value of attribute user_agent.



3
4
5
# File 'lib/url_resolver/configuration.rb', line 3

def user_agent
  @user_agent
end