module Enviso::Config
Configuration object for storing some parameters required for making transactions
Attributes
api_key[RW]
api_link[RW]
api_secret[RW]
api_version[RW]
environment[RW]
tenant_key[RW]
verbose[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/enviso/config.rb, line 19 def init! @defaults = { :@api_key => nil, :@api_secret => nil, :@tenant_key => nil, :@verbose => false, :@environment => :test, :@api_version => 1, :@api_link => "https://api.staging-enviso.io/resellingapi/" } end
reset!()
click to toggle source
Resets the value's to there previous value (instance_variable) @return [Hash] configuration options
# File lib/enviso/config.rb, line 33 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/enviso/config.rb, line 39 def update! @defaults.each do |key, value| instance_variable_set(key, value) unless instance_variable_defined?(key) end end