Class: PuppetEc2Enc::ENC
- Inherits:
-
Object
- Object
- PuppetEc2Enc::ENC
- Defined in:
- lib/puppet_ec2_enc/enc.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#role ⇒ Object
Returns the value of attribute role.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ ENC
constructor
A new instance of ENC.
- #output ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ ENC
Returns a new instance of ENC.
7 8 9 10 |
# File 'lib/puppet_ec2_enc/enc.rb', line 7 def initialize(opts = {}) @role = opts[:role] || nil @environment = opts[:environment] || nil end |
Instance Attribute Details
#environment ⇒ Object
Returns the value of attribute environment.
5 6 7 |
# File 'lib/puppet_ec2_enc/enc.rb', line 5 def environment @environment end |
#role ⇒ Object
Returns the value of attribute role.
5 6 7 |
# File 'lib/puppet_ec2_enc/enc.rb', line 5 def role @role end |
Instance Method Details
#output ⇒ Object
12 13 14 15 16 |
# File 'lib/puppet_ec2_enc/enc.rb', line 12 def output classes = [] classes << "role::#{role}" if role { 'classes' => classes, 'environment' => environment }.to_yaml end |