Module: Docdata::Config
- Defined in:
- lib/docdata/config.rb
Overview
Configuration object for storing some parameters required for making transactions
Class Attribute Summary collapse
-
.password ⇒ String
Your DocData password.
-
.return_url ⇒ String
Base return URL.
-
.test_mode ⇒ Boolean
Test mode switch.
-
.username ⇒ String
Your DocData username.
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
.password ⇒ String
Returns Your DocData password.
10 11 12 |
# File 'lib/docdata/config.rb', line 10 def password @password end |
.return_url ⇒ String
Returns Base return URL.
14 15 16 |
# File 'lib/docdata/config.rb', line 14 def return_url @return_url end |
.test_mode ⇒ Boolean
Returns Test mode switch.
12 13 14 |
# File 'lib/docdata/config.rb', line 12 def test_mode @test_mode end |
.username ⇒ String
Note:
The is a required parameter.
Returns Your DocData username.
8 9 10 |
# File 'lib/docdata/config.rb', line 8 def username @username end |
Class Method Details
.init! ⇒ Hash
Set's the default value's to nil and false
19 20 21 22 23 24 25 26 |
# File 'lib/docdata/config.rb', line 19 def init! @defaults = { :@username => nil, :@password => nil, :@test_mode => false, :@return_url => nil } end |
.reset! ⇒ Hash
Resets the value's to there previous value (instance_variable)
30 31 32 |
# File 'lib/docdata/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/docdata/config.rb', line 36 def update! @defaults.each do |key, value| instance_variable_set(key, value) unless instance_variable_defined?(key) end end |