Class: Shippy::Secrets

Inherits:
Object
  • Object
show all
Defined in:
lib/shippy/secrets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Secrets

Returns a new instance of Secrets.



5
6
7
# File 'lib/shippy/secrets.rb', line 5

def initialize(file)
  @data = YAML.load_file(file).deep_symbolize_keys
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/shippy/secrets.rb', line 3

def data
  @data
end

Instance Method Details

#fetch(app, name) ⇒ Object



9
10
11
12
13
# File 'lib/shippy/secrets.rb', line 9

def fetch(app, name)
  data
    .fetch(app.to_sym)
    .fetch(name.to_sym)
end