Module: ServiceNow::Configuration
- Defined in:
- lib/servicenow/configuration.rb
Constant Summary collapse
- VALID_OPTIONS_KEYS =
[ :user_agent, ].freeze
- DEFAULT_USER_AGENT =
"ServiceNow Ruby Gem #{ServiceNow::VERSION}".freeze
Class Method Summary collapse
-
.extended(base) ⇒ Object
When this module is extended, set all configuration options to their default values.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block.
-
#options ⇒ Object
Create a hash of options and their values.
- #reset ⇒ Object
Class Method Details
.extended(base) ⇒ Object
When this module is extended, set all configuration options to their default values
18 19 20 |
# File 'lib/servicenow/configuration.rb', line 18 def self.extended(base) base.reset end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block
13 14 15 |
# File 'lib/servicenow/configuration.rb', line 13 def configure yield self end |
#options ⇒ Object
Create a hash of options and their values
23 24 25 26 27 |
# File 'lib/servicenow/configuration.rb', line 23 def VALID_OPTIONS_KEYS.inject({}) do |option, key| option.merge!(key => send(key)) end end |
#reset ⇒ Object
29 30 31 32 |
# File 'lib/servicenow/configuration.rb', line 29 def reset self.debug = DEFAULT_DEBUG self.user_agent = DEFAULT_USER_AGENT end |