Class: Cfer::Provisioning::ConfigSet
- Inherits:
-
Object
- Object
- Cfer::Provisioning::ConfigSet
- Defined in:
- lib/cfer/provisioning/cfn-bootstrap.rb
Instance Method Summary collapse
- #command(name, cmd, options = {}) ⇒ Object
- #commands ⇒ Object
- #file(path, options = {}) ⇒ Object
- #files ⇒ Object
-
#initialize(hash) ⇒ ConfigSet
constructor
A new instance of ConfigSet.
- #package(type, name, versions = []) ⇒ Object
- #packages ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(hash) ⇒ ConfigSet
Returns a new instance of ConfigSet.
45 46 47 |
# File 'lib/cfer/provisioning/cfn-bootstrap.rb', line 45 def initialize(hash) @config_set = hash || {} end |
Instance Method Details
#command(name, cmd, options = {}) ⇒ Object
65 66 67 |
# File 'lib/cfer/provisioning/cfn-bootstrap.rb', line 65 def command(name, cmd, = {}) commands[name] = .merge('command' => cmd) end |
#commands ⇒ Object
53 54 55 |
# File 'lib/cfer/provisioning/cfn-bootstrap.rb', line 53 def commands @config_set['commands'] ||= {} end |
#file(path, options = {}) ⇒ Object
69 70 71 |
# File 'lib/cfer/provisioning/cfn-bootstrap.rb', line 69 def file(path, = {}) files[path] = end |
#files ⇒ Object
57 58 59 |
# File 'lib/cfer/provisioning/cfn-bootstrap.rb', line 57 def files @config_set['files'] ||= {} end |
#package(type, name, versions = []) ⇒ Object
73 74 75 76 |
# File 'lib/cfer/provisioning/cfn-bootstrap.rb', line 73 def package(type, name, versions = []) packages[type] ||= {} packages[type][name] = versions end |
#packages ⇒ Object
61 62 63 |
# File 'lib/cfer/provisioning/cfn-bootstrap.rb', line 61 def packages @config_set['packages'] ||= {} end |
#to_h ⇒ Object
49 50 51 |
# File 'lib/cfer/provisioning/cfn-bootstrap.rb', line 49 def to_h @config_set end |