Module: Locksmith::Config
Instance Method Summary collapse
- #aws_id ⇒ Object
- #aws_id=(value) ⇒ Object
- #aws_secret ⇒ Object
- #aws_secret=(value) ⇒ Object
- #env(key) ⇒ Object
- #env!(key) ⇒ Object
- #env?(key) ⇒ Boolean
- #pg_lock_space ⇒ Object
Instance Method Details
#aws_id ⇒ Object
22 23 24 |
# File 'lib/locksmith/config.rb', line 22 def aws_id @aws_id ||= env!("AWS_ID") end |
#aws_id=(value) ⇒ Object
30 |
# File 'lib/locksmith/config.rb', line 30 def aws_id=(value); @aws_id = value; end |
#aws_secret ⇒ Object
26 27 28 |
# File 'lib/locksmith/config.rb', line 26 def aws_secret @aws_secret ||= env!("AWS_SECRET") end |
#aws_secret=(value) ⇒ Object
31 |
# File 'lib/locksmith/config.rb', line 31 def aws_secret=(value); @aws_secret = value; end |
#env(key) ⇒ Object
5 6 7 |
# File 'lib/locksmith/config.rb', line 5 def env(key) ENV[key] end |
#env!(key) ⇒ Object
9 10 11 |
# File 'lib/locksmith/config.rb', line 9 def env!(key) env(key) || raise("Locksmith is missing #{key}") end |
#env?(key) ⇒ Boolean
13 14 15 |
# File 'lib/locksmith/config.rb', line 13 def env?(key) !env(key).nil? end |
#pg_lock_space ⇒ Object
17 18 19 20 |
# File 'lib/locksmith/config.rb', line 17 def pg_lock_space n = "LOCKSMITH_PG_LOCK_SPACE" env(n) && env(n).to_i end |