Class: Foreplay::Engine::Secrets

Inherits:
Object
  • Object
show all
Defined in:
lib/foreplay/engine/secrets.rb,
lib/foreplay/engine/secrets/location.rb

Defined Under Namespace

Classes: Location

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(e, sl) ⇒ Secrets

Returns a new instance of Secrets.



8
9
10
11
# File 'lib/foreplay/engine/secrets.rb', line 8

def initialize(e, sl)
  @environment = e
  @secret_locations = sl
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



6
7
8
# File 'lib/foreplay/engine/secrets.rb', line 6

def environment
  @environment
end

#secret_locationsObject (readonly)

Returns the value of attribute secret_locations.



6
7
8
# File 'lib/foreplay/engine/secrets.rb', line 6

def secret_locations
  @secret_locations
end

Instance Method Details

#fetchObject



13
14
15
16
17
18
19
# File 'lib/foreplay/engine/secrets.rb', line 13

def fetch
  return unless secret_locations

  secrets = {}
  secret_locations.each { |secret_location| secrets.merge! location_secrets(secret_location) }
  secrets
end

#location_secrets(secret_location) ⇒ Object



21
22
23
# File 'lib/foreplay/engine/secrets.rb', line 21

def location_secrets(secret_location)
  Location.new(secret_location, environment).secrets
end