Class: Authsignal::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/authsignal/configuration.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



20
21
22
23
24
25
26
27
28
29
# File 'lib/authsignal/configuration.rb', line 20

def initialize
    @config_values = {}
      
    # set default attribute values
    @defaults = OpenStruct.new({
        base_uri: 'https://signal.authsignal.com/v1/',
        retry: false,
        debug: false
    })
end

Class Method Details

.config_option(name) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/authsignal/configuration.rb', line 5

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



31
32
33
# File 'lib/authsignal/configuration.rb', line 31

def [](key)
    read_value(key)
end

#[]=(key, value) ⇒ Object



35
36
37
# File 'lib/authsignal/configuration.rb', line 35

def []=(key, value)
    set_value(key, value)
end