Class: Ridley::Role
- Inherits:
-
Object
- Object
- Ridley::Role
- Includes:
- Resource
- Defined in:
- lib/ridley/resources/role.rb
Instance Method Summary collapse
- #default_attributes=(hash) ⇒ Object
- #override_attributes=(hash) ⇒ Object
-
#set_default_attribute(key, value) ⇒ HashWithIndifferentAccess
Set a role level default attribute given the dotted path representation of the Chef attribute and value.
-
#set_override_attribute(key, value) ⇒ HashWithIndifferentAccess
Set a role level override attribute given the dotted path representation of the Chef attribute and value.
Methods included from Resource
#<=>, #==, #attribute, #attribute=, #attribute?, #attributes, #attributes=, #chef_id, #eql?, #from_hash, #from_json, #hash, #initialize, #reload, #save, #to_hash, #to_json, #to_s
Instance Method Details
#default_attributes=(hash) ⇒ Object
21 22 23 |
# File 'lib/ridley/resources/role.rb', line 21 def default_attributes=(hash) super(HashWithIndifferentAccess.new(hash)) end |
#override_attributes=(hash) ⇒ Object
26 27 28 |
# File 'lib/ridley/resources/role.rb', line 26 def override_attributes=(hash) super(HashWithIndifferentAccess.new(hash)) end |
#set_default_attribute(key, value) ⇒ HashWithIndifferentAccess
Set a role level default attribute given the dotted path representation of the Chef attribute and value
61 62 63 64 |
# File 'lib/ridley/resources/role.rb', line 61 def set_default_attribute(key, value) attr_hash = HashWithIndifferentAccess.from_dotted_path(key, value) self.default_attributes = self.default_attributes.deep_merge(attr_hash) end |
#set_override_attribute(key, value) ⇒ HashWithIndifferentAccess
Set a role level override attribute given the dotted path representation of the Chef attribute and value
43 44 45 46 |
# File 'lib/ridley/resources/role.rb', line 43 def set_override_attribute(key, value) attr_hash = HashWithIndifferentAccess.from_dotted_path(key, value) self.override_attributes = self.override_attributes.deep_merge(attr_hash) end |