Class: Upcheck::Configuration
- Inherits:
-
Object
- Object
- Upcheck::Configuration
- Defined in:
- lib/upcheck/configuration.rb
Constant Summary collapse
- DEFAULT_HTTP_TIMEOUT =
5
Instance Attribute Summary collapse
-
#http_timeout ⇒ Object
Returns the value of attribute http_timeout.
-
#providers ⇒ Object
readonly
Returns the value of attribute providers.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #register_provider(name, &block) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 |
# File 'lib/upcheck/configuration.rb', line 10 def initialize @http_timeout = DEFAULT_HTTP_TIMEOUT @providers = {} Registry.register_defaults(self) end |
Instance Attribute Details
#http_timeout ⇒ Object
Returns the value of attribute http_timeout.
7 8 9 |
# File 'lib/upcheck/configuration.rb', line 7 def http_timeout @http_timeout end |
#providers ⇒ Object (readonly)
Returns the value of attribute providers.
8 9 10 |
# File 'lib/upcheck/configuration.rb', line 8 def providers @providers end |
Instance Method Details
#register_provider(name, &block) ⇒ Object
16 17 18 19 20 |
# File 'lib/upcheck/configuration.rb', line 16 def register_provider(name, &block) raise ArgumentError, "register_provider requires a block returning an adapter" unless block @providers[name.to_sym] = block end |