Module: PagerDuty::Configurable
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#connection_options ⇒ Object
Returns the value of attribute connection_options.
-
#default_media_type ⇒ Object
Returns the value of attribute default_media_type.
-
#middleware ⇒ Object
Returns the value of attribute middleware.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Class Method Summary collapse
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Set configuration options using a block.
-
#reset! ⇒ Object
(also: #setup)
Reset configuration options to default values.
Instance Attribute Details
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
3 4 5 |
# File 'lib/pager_duty/configurable.rb', line 3 def api_endpoint @api_endpoint end |
#api_token ⇒ Object
Returns the value of attribute api_token.
3 4 5 |
# File 'lib/pager_duty/configurable.rb', line 3 def api_token @api_token end |
#connection_options ⇒ Object
Returns the value of attribute connection_options.
3 4 5 |
# File 'lib/pager_duty/configurable.rb', line 3 def @connection_options end |
#default_media_type ⇒ Object
Returns the value of attribute default_media_type.
3 4 5 |
# File 'lib/pager_duty/configurable.rb', line 3 def default_media_type @default_media_type end |
#middleware ⇒ Object
Returns the value of attribute middleware.
3 4 5 |
# File 'lib/pager_duty/configurable.rb', line 3 def middleware @middleware end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
3 4 5 |
# File 'lib/pager_duty/configurable.rb', line 3 def user_agent @user_agent end |
Class Method Details
.keys ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/pager_duty/configurable.rb', line 6 def keys @keys ||= [ :api_token, :api_endpoint, :default_media_type, :user_agent, :middleware, :connection_options ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Set configuration options using a block
19 20 21 |
# File 'lib/pager_duty/configurable.rb', line 19 def configure yield self end |
#reset! ⇒ Object Also known as: setup
Reset configuration options to default values
24 25 26 27 28 29 |
# File 'lib/pager_duty/configurable.rb', line 24 def reset! PagerDuty::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", PagerDuty::Default.[key]) end self end |