Class: Dacom::Config
- Inherits:
-
Object
- Object
- Dacom::Config
- Defined in:
- lib/dacom/config.rb
Constant Summary collapse
- CONFIG_PATH =
File::("../../../config/dacom.yml", __FILE__)
Instance Method Summary collapse
-
#initialize(path = CONFIG_PATH) ⇒ Config
constructor
A new instance of Config.
- #merchant_id ⇒ Object
- #merchant_key ⇒ Object
- #platform ⇒ Object
- #url ⇒ Object
- #verify_peer? ⇒ Boolean
Constructor Details
#initialize(path = CONFIG_PATH) ⇒ Config
Returns a new instance of Config.
8 9 10 11 |
# File 'lib/dacom/config.rb', line 8 def initialize(path = CONFIG_PATH) @path = path @config = fetch_config end |
Instance Method Details
#merchant_id ⇒ Object
24 25 26 27 |
# File 'lib/dacom/config.rb', line 24 def merchant_id return @config.fetch("test_mert_id") if test_mode? @config.fetch("mert_id") end |
#merchant_key ⇒ Object
29 30 31 32 |
# File 'lib/dacom/config.rb', line 29 def merchant_key return @config.fetch("test_mert_key") if test_mode? @config.fetch("mert_key") end |
#platform ⇒ Object
34 35 36 37 |
# File 'lib/dacom/config.rb', line 34 def platform return "test".freeze if test_mode? "service".freeze end |
#url ⇒ Object
19 20 21 22 |
# File 'lib/dacom/config.rb', line 19 def url return @config.fetch("test_url") if test_mode? @config.fetch("url") end |
#verify_peer? ⇒ Boolean
39 40 41 |
# File 'lib/dacom/config.rb', line 39 def verify_peer? verify_cert || verify_host end |