Class: Unrest::Configuration
- Inherits:
-
Object
- Object
- Unrest::Configuration
- Includes:
- Singleton
- Defined in:
- lib/unrest/configuration.rb
Constant Summary collapse
- OPTIONS =
[ :https, :timeout, :headers, :parameters, :authentication ]
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Class Method Summary collapse
Instance Method Summary collapse
- #configure(options) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #set_defaults ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
45 46 47 48 |
# File 'lib/unrest/configuration.rb', line 45 def initialize @data = Unrest::ConfigurationHash.new set_defaults end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
26 27 28 |
# File 'lib/unrest/configuration.rb', line 26 def data @data end |
Class Method Details
.set_defaults ⇒ Object
28 29 30 |
# File 'lib/unrest/configuration.rb', line 28 def self.set_defaults instance.set_defaults end |
Instance Method Details
#configure(options) ⇒ Object
41 42 43 |
# File 'lib/unrest/configuration.rb', line 41 def configure() @data.rmerge!() end |
#set_defaults ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/unrest/configuration.rb', line 50 def set_defaults @data[:https] = false @data[:timeout] = 5 @data[:headers] = {} @data[:parameters] = {} @data[:authentication] = {} end |