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
- .shortcut_url(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 31 32 |
# 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'] when :test 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
64 65 66 |
# File 'lib/lhj/helper/pgyer_config.rb', line 64 def self.password(env = :uat) config['password'] end |
.shortcut_url(env = :uat) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/lhj/helper/pgyer_config.rb', line 49 def self.shortcut_url(env = :uat) case env when :release config['release_shortcut_url'] when :gray config['gray_shortcut_url'] when :uat config['uat_shortcut_url'] when :test config['uat_shortcut_url'] else config['shortcut_url'] end end |
.user_key(env = :uat) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/lhj/helper/pgyer_config.rb', line 34 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'] when :test config['uat_user_key'] else config['user_key'] end end |