Class: Lhj::PgyerConfig
- Inherits:
-
Object
- Object
- Lhj::PgyerConfig
- Defined in:
- lib/lhj/helper/pgyer_config.rb
Overview
pgyer config
Constant Summary collapse
- CONFIG_NAME =
'pgyer_config.yml'
Class Method Summary collapse
- .api_key(env = :uat) ⇒ Object
- .config ⇒ Object
- .config_file ⇒ Object
- .password(env = :uat) ⇒ Object
- .user_key(env = :uat) ⇒ Object
Class Method Details
.api_key(env = :uat) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/lhj/helper/pgyer_config.rb', line 19 def self.api_key(env = :uat) case env when :release config['release_api_key'] when :gray config['gray_api_key'] when :uat config['uat_api_key'] else config['api_key'] end end |
.config ⇒ Object
15 16 17 |
# File 'lib/lhj/helper/pgyer_config.rb', line 15 def self.config @yaml ||= YAML.load_file(config_file) end |
.config_file ⇒ Object
11 12 13 |
# File 'lib/lhj/helper/pgyer_config.rb', line 11 def self.config_file File.join(Lhj::Config.instance.home_dir, CONFIG_NAME) end |
.password(env = :uat) ⇒ Object
45 46 47 |
# File 'lib/lhj/helper/pgyer_config.rb', line 45 def self.password(env = :uat) config['password'] end |
.user_key(env = :uat) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/lhj/helper/pgyer_config.rb', line 32 def self.user_key(env = :uat) case env when :release config['release_user_key'] when :gray config['gray_user_key'] when :uat config['uat_user_key'] else config['user_key'] end end |