module Docdata::Config
Configuration object for storing some parameters required for making transactions
Attributes
password[RW]
@return [String] Your DocData password
return_url[RW]
@return [String] Base return URL
test_mode[RW]
@return [Boolean] Test mode switch
username[RW]
@return [String] Your DocData username @note The is a required parameter.
Public Class Methods
init!()
click to toggle source
Set’s the default value’s to nil and false @return [Hash] configuration options
# File lib/docdata/config.rb, line 19 def init! @defaults = { :@username => nil, :@password => nil, :@test_mode => false, :@return_url => nil } end
reset!()
click to toggle source
Resets the value’s to there previous value (instance_variable) @return [Hash] configuration options
# File lib/docdata/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/docdata/config.rb, line 36 def update! @defaults.each do |key, value| instance_variable_set(key, value) unless instance_variable_defined?(key) end end