module ShakeTheCounter::Config

Configuration object for storing some parameters required for making transactions

Attributes

client_id[RW]
client_secret[RW]
environment[RW]
language_code[RW]
refresh_token[RW]
verbose[RW]
version[RW]

Public Class Methods

init!() click to toggle source

Set's the default value's to nil and false @return [Hash] configuration options

# 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!() click to toggle source

Resets the value's to there previous value (instance_variable) @return [Hash] configuration options

# File lib/shake_the_counter/config.rb, line 30
def reset!
  @defaults.each { |key, value| instance_variable_set(key, value) }
end
update!() click to toggle source

Set's the new value's as instance variables @return [Hash] configuration options

# 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