Module: Strife::Configurable
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
writeonly
Sets the attribute api_endpoint.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#region ⇒ Object
Returns the value of attribute region.
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#api_endpoint=(value) ⇒ Object (writeonly)
Sets the attribute api_endpoint
4 5 6 |
# File 'lib/strife/configurable.rb', line 4 def api_endpoint=(value) @api_endpoint = value end |
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/strife/configurable.rb', line 3 def api_key @api_key end |
#region ⇒ Object
Returns the value of attribute region.
3 4 5 |
# File 'lib/strife/configurable.rb', line 3 def region @region end |
Class Method Details
.keys ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/strife/configurable.rb', line 7 def keys @keys ||= [ :api_key, :api_endpoint, :user_agent, :default_media_type, :connection_options, :middleware, :region ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
20 21 22 |
# File 'lib/strife/configurable.rb', line 20 def configure yield self end |
#reset! ⇒ Object Also known as: setup
24 25 26 27 28 29 30 |
# File 'lib/strife/configurable.rb', line 24 def reset! Strife::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Strife::Default.[key]) end self end |