Class: Ridley::RoleObject
- Inherits:
-
ChefObject
- Object
- ChefObject
- Ridley::RoleObject
- Defined in:
- lib/ridley/chef_objects/role_object.rb
Instance Method Summary collapse
-
#set_default_attribute(key, value) ⇒ Hashie::Mash
Set a role level default attribute given the dotted path representation of the Chef attribute and value.
-
#set_override_attribute(key, value) ⇒ Hashie::Mash
Set a role level override attribute given the dotted path representation of the Chef attribute and value.
Methods inherited from ChefObject
#<=>, #==, chef_id, #chef_id, chef_json_class, chef_type, #eql?, #hash, #initialize, #inspect, #reload, #save, set_chef_id, set_chef_json_class, set_chef_type, #update
Constructor Details
This class inherits a constructor from Ridley::ChefObject
Instance Method Details
#set_default_attribute(key, value) ⇒ Hashie::Mash
Set a role level default attribute given the dotted path representation of the Chef attribute and value
56 57 58 59 |
# File 'lib/ridley/chef_objects/role_object.rb', line 56 def set_default_attribute(key, value) attr_hash = Hashie::Mash.from_dotted_path(key, value) self.default_attributes = self.default_attributes.deep_merge(attr_hash) end |
#set_override_attribute(key, value) ⇒ Hashie::Mash
Set a role level override attribute given the dotted path representation of the Chef attribute and value
38 39 40 41 |
# File 'lib/ridley/chef_objects/role_object.rb', line 38 def set_override_attribute(key, value) attr_hash = Hashie::Mash.from_dotted_path(key, value) self.override_attributes = self.override_attributes.deep_merge(attr_hash) end |