Class: UrlResolver::Configuration
- Inherits:
-
Object
- Object
- UrlResolver::Configuration
- 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
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#cache_failures ⇒ Object
Returns the value of attribute cache_failures.
-
#errors_to_ignore ⇒ Object
Returns the value of attribute errors_to_ignore.
-
#url_cache ⇒ Object
readonly
Returns the value of attribute url_cache.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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
#cache ⇒ Object
Returns the value of attribute cache.
4 5 6 |
# File 'lib/url_resolver/configuration.rb', line 4 def cache @cache end |
#cache_failures ⇒ Object
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_ignore ⇒ Object
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_cache ⇒ Object (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_agent ⇒ Object
Returns the value of attribute user_agent.
3 4 5 |
# File 'lib/url_resolver/configuration.rb', line 3 def user_agent @user_agent end |