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.
-
#hosting_id ⇒ Object
Returns the value of attribute hosting_id.
-
#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.
8 9 10 |
# File 'lib/ivapi/configuration.rb', line 8 def api_endpoint @api_endpoint end |
#connection_options ⇒ Object
Returns the value of attribute connection_options.
8 9 10 |
# File 'lib/ivapi/configuration.rb', line 8 def @connection_options end |
#hosting_id ⇒ Object
Returns the value of attribute hosting_id.
8 9 10 |
# File 'lib/ivapi/configuration.rb', line 8 def hosting_id @hosting_id end |
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/ivapi/configuration.rb', line 8 def password @password end |
#server_id ⇒ Object
Returns the value of attribute server_id.
8 9 10 |
# File 'lib/ivapi/configuration.rb', line 8 def server_id @server_id end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
8 9 10 |
# File 'lib/ivapi/configuration.rb', line 8 def user_agent @user_agent end |
#username ⇒ Object
Returns the value of attribute username.
8 9 10 |
# File 'lib/ivapi/configuration.rb', line 8 def username @username end |
#web_endpoint ⇒ Object
Returns the value of attribute web_endpoint.
8 9 10 |
# File 'lib/ivapi/configuration.rb', line 8 def web_endpoint @web_endpoint end |
Class Method Details
.each_key(&block) ⇒ Object
24 25 26 |
# File 'lib/ivapi/configuration.rb', line 24 def self.each_key(&block) keys.each(&block) end |
.keys ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ivapi/configuration.rb', line 11 def self.keys @keys ||= %i[ api_endpoint username middleware password user_agent connection_options server_id hosting_id ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
28 29 30 31 |
# File 'lib/ivapi/configuration.rb', line 28 def configure yield self true end |
#reset! ⇒ Object Also known as: setup
Reset configuration options to default values
34 35 36 37 38 39 |
# File 'lib/ivapi/configuration.rb', line 34 def reset! Ivapi::Configuration.each_key do |key| instance_variable_set(:"@#{key}", Ivapi::Default.[key]) end self end |