Module: Ivapi::Configuration
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
-
#connection_options ⇒ Object
Returns the value of attribute connection_options.
-
#password ⇒ Object
Returns the value of attribute password.
-
#server_id ⇒ Object
Returns the value of attribute server_id.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
-
#username ⇒ Object
Returns the value of attribute username.
-
#web_endpoint ⇒ Object
Returns the value of attribute web_endpoint.
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
-
#reset! ⇒ Object
(also: #setup)
Reset configuration options to default values.
Instance Attribute Details
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
6 7 8 |
# File 'lib/ivapi/configuration.rb', line 6 def api_endpoint @api_endpoint end |
#connection_options ⇒ Object
Returns the value of attribute connection_options.
6 7 8 |
# File 'lib/ivapi/configuration.rb', line 6 def end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/ivapi/configuration.rb', line 6 def password @password end |
#server_id ⇒ Object
Returns the value of attribute server_id.
6 7 8 |
# File 'lib/ivapi/configuration.rb', line 6 def server_id @server_id end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
6 7 8 |
# File 'lib/ivapi/configuration.rb', line 6 def user_agent @user_agent end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/ivapi/configuration.rb', line 6 def username @username end |
#web_endpoint ⇒ Object
Returns the value of attribute web_endpoint.
6 7 8 |
# File 'lib/ivapi/configuration.rb', line 6 def web_endpoint @web_endpoint end |
Class Method Details
.keys ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ivapi/configuration.rb', line 9 def self.keys @keys ||= [ :api_endpoint, :server_id, :username, :middleware, :password, :user_agent, :connection_options ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
21 22 23 24 |
# File 'lib/ivapi/configuration.rb', line 21 def configure yield self true end |
#reset! ⇒ Object Also known as: setup
Reset configuration options to default values
27 28 29 30 31 32 |
# File 'lib/ivapi/configuration.rb', line 27 def reset! Ivapi::Configuration.keys.each do |key| instance_variable_set(:"@#{key}", Ivapi::Default.[key]) end self end |