Class: Authsignal::Configuration
- Inherits:
-
Object
- Object
- Authsignal::Configuration
- Defined in:
- lib/authsignal/configuration.rb
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/authsignal/configuration.rb', line 22 def initialize @config_values = {} # set default attribute values @defaults = { api_url: 'https://signal.authsignal.com/v1/', retry: false, debug: false } end |
Instance Attribute Details
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
5 6 7 |
# File 'lib/authsignal/configuration.rb', line 5 def defaults @defaults end |
Class Method Details
.config_option(name) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/authsignal/configuration.rb', line 7 def self.config_option(name) define_method(name) do read_value(name) end define_method("#{name}=") do |value| set_value(name, value) end end |
Instance Method Details
#[](key) ⇒ Object
33 34 35 |
# File 'lib/authsignal/configuration.rb', line 33 def [](key) read_value(key) end |
#[]=(key, value) ⇒ Object
37 38 39 |
# File 'lib/authsignal/configuration.rb', line 37 def []=(key, value) set_value(key, value) end |