Module: Vindi::Configuration
- Included in:
- Client
- Defined in:
- lib/vindi/configuration.rb
Overview
Configuration options for Client
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
-
#connection_options ⇒ Object
readonly
Returns the value of attribute connection_options.
-
#default_media_type ⇒ Object
Returns the value of attribute default_media_type.
-
#key ⇒ Object
Returns the value of attribute key.
-
#middleware ⇒ Object
readonly
Returns the value of attribute middleware.
-
#user_agent ⇒ Object
readonly
Returns the value of attribute user_agent.
Class Method Summary collapse
Instance Method Summary collapse
-
#configure(options = {}) {|_self| ... } ⇒ Vindi::Client
Initializes a new Client object.
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
8 9 10 |
# File 'lib/vindi/configuration.rb', line 8 def api_endpoint @api_endpoint end |
#connection_options ⇒ Object (readonly)
Returns the value of attribute connection_options.
7 8 9 |
# File 'lib/vindi/configuration.rb', line 7 def @connection_options end |
#default_media_type ⇒ Object
Returns the value of attribute default_media_type.
8 9 10 |
# File 'lib/vindi/configuration.rb', line 8 def default_media_type @default_media_type end |
#key ⇒ Object
Returns the value of attribute key.
8 9 10 |
# File 'lib/vindi/configuration.rb', line 8 def key @key end |
#middleware ⇒ Object (readonly)
Returns the value of attribute middleware.
7 8 9 |
# File 'lib/vindi/configuration.rb', line 7 def middleware @middleware end |
#user_agent ⇒ Object (readonly)
Returns the value of attribute user_agent.
7 8 9 |
# File 'lib/vindi/configuration.rb', line 7 def user_agent @user_agent end |
Class Method Details
.keys ⇒ Object
11 12 13 14 |
# File 'lib/vindi/configuration.rb', line 11 def keys @keys ||= [:key, :default_media_type, :api_endpoint, :user_agent, :middleware, :connection_options] end |
Instance Method Details
#configure(options = {}) {|_self| ... } ⇒ Vindi::Client
Initializes a new Client object
21 22 23 24 25 26 27 |
# File 'lib/vindi/configuration.rb', line 21 def configure( = {}) .each do |key, value| instance_variable_set("@#{key}", value) end yield(self) if block_given? end |
#reset! ⇒ Object Also known as: setup
29 30 31 32 33 |
# File 'lib/vindi/configuration.rb', line 29 def reset! Vindi::Configuration.keys.each do |key| instance_variable_set("@#{key}", Vindi::Default.[key]) end end |