Module: ShakeTheCounter::Config
- Defined in:
- lib/shake_the_counter/config.rb
Overview
Configuration object for storing some parameters required for making transactions
Class Attribute Summary collapse
-
.client_id ⇒ Object
Returns the value of attribute client_id.
-
.client_secret ⇒ Object
Returns the value of attribute client_secret.
-
.environment ⇒ Object
Returns the value of attribute environment.
-
.language_code ⇒ Object
Returns the value of attribute language_code.
-
.refresh_token ⇒ Object
Returns the value of attribute refresh_token.
-
.verbose ⇒ Object
if set, give more output in the log/console.
-
.version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
-
.init! ⇒ Hash
Set’s the default value’s to nil and false.
-
.reset! ⇒ Hash
Resets the value’s to there previous value (instance_variable).
-
.update! ⇒ Hash
Set’s the new value’s as instance variables.
Class Attribute Details
.client_id ⇒ Object
Returns the value of attribute client_id.
6 7 8 |
# File 'lib/shake_the_counter/config.rb', line 6 def client_id @client_id end |
.client_secret ⇒ Object
Returns the value of attribute client_secret.
7 8 9 |
# File 'lib/shake_the_counter/config.rb', line 7 def client_secret @client_secret end |
.environment ⇒ Object
Returns the value of attribute environment.
9 10 11 |
# File 'lib/shake_the_counter/config.rb', line 9 def environment @environment end |
.language_code ⇒ Object
Returns the value of attribute language_code.
10 11 12 |
# File 'lib/shake_the_counter/config.rb', line 10 def language_code @language_code end |
.refresh_token ⇒ Object
Returns the value of attribute refresh_token.
8 9 10 |
# File 'lib/shake_the_counter/config.rb', line 8 def refresh_token @refresh_token end |
.verbose ⇒ Object
if set, give more output in the log/console
12 13 14 |
# File 'lib/shake_the_counter/config.rb', line 12 def verbose @verbose end |
.version ⇒ Object
Returns the value of attribute version.
11 12 13 |
# File 'lib/shake_the_counter/config.rb', line 11 def version @version end |
Class Method Details
.init! ⇒ Hash
Set’s the default value’s to nil and false
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/shake_the_counter/config.rb', line 16 def init! @defaults = { :@refresh_token => ENV["STC_REFRESH_TOKEN"], :@client_id => ENV["STC_CLIENT_ID"], :@client_secret => ENV["STC_CLIENT_SECRET"], :@language_code => "nl-NL", :@environment => 'test', :@version => 1, :@verbose => false, } end |
.reset! ⇒ Hash
Resets the value’s to there previous value (instance_variable)
30 31 32 |
# File 'lib/shake_the_counter/config.rb', line 30 def reset! @defaults.each { |key, value| instance_variable_set(key, value) } end |
.update! ⇒ Hash
Set’s the new value’s as instance variables
36 37 38 39 40 |
# File 'lib/shake_the_counter/config.rb', line 36 def update! @defaults.each do |key, value| instance_variable_set(key, value) unless instance_variable_defined?(key) end end |