Module: Locksmith::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/locksmith/config.rb

Instance Method Summary collapse

Instance Method Details

#aws_idObject



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_secretObject



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

Returns:

  • (Boolean)


13
14
15
# File 'lib/locksmith/config.rb', line 13

def env?(key)
  !env(key).nil?
end

#pg_lock_spaceObject



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