Module: Tencentpay::Config
- Defined in:
- lib/tencentpay/config.rb
Class Attribute Summary collapse
-
.bargainor_id ⇒ Object
readonly
Returns the value of attribute bargainor_id.
-
.key ⇒ Object
readonly
Returns the value of attribute key.
Class Method Summary collapse
Class Attribute Details
.bargainor_id ⇒ Object (readonly)
Returns the value of attribute bargainor_id.
4 5 6 |
# File 'lib/tencentpay/config.rb', line 4 def @bargainor_id end |
.key ⇒ Object (readonly)
Returns the value of attribute key.
4 5 6 |
# File 'lib/tencentpay/config.rb', line 4 def key @key end |
Class Method Details
.load_config ⇒ Object
6 7 8 9 10 11 |
# File 'lib/tencentpay/config.rb', line 6 def load_config filename = "#{Rails.root}/config/tencentpay.yml" config = YAML.load(File.open(filename)) @bargainor_id, @key = config[RAILS_ENV]['bargainor_id'], config[RAILS_ENV]['key'] raise "Please configure your Tencentpay settings in #{filename}." unless @@spid && @@key end |