Module: Inthegra::Configuration
- Included in:
- Inthegra
- Defined in:
- lib/inthegra/configuration.rb
Constant Summary collapse
- VALID_OPTIONS =
Default options of the configuration module
[ :email, :password, :api_key, :auth_token, :proxy, :user_agent, :endpoint ]
- DEFAULT_ENDPOINT =
'https://api.inthegra.strans.teresina.pi.gov.br/v1'
Class Method Summary collapse
-
.extended(base) ⇒ Object
Set default value when this methods is extented.
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
-
#options ⇒ Object
Return the array of options.
- #set_default_values ⇒ Object
Class Method Details
.extended(base) ⇒ Object
Set default value when this methods is extented
21 22 23 |
# File 'lib/inthegra/configuration.rb', line 21 def self.extended(base) base.set_default_values end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
25 26 27 |
# File 'lib/inthegra/configuration.rb', line 25 def configure yield self end |
#options ⇒ Object
Return the array of options
34 35 36 37 38 |
# File 'lib/inthegra/configuration.rb', line 34 def VALID_OPTIONS.inject({}) do |option, key| option.merge!(key => send(key)) end end |
#set_default_values ⇒ Object
29 30 31 |
# File 'lib/inthegra/configuration.rb', line 29 def set_default_values self.endpoint = DEFAULT_ENDPOINT end |