Class: Ridley::RoleResource
- Defined in:
- lib/ridley/resources/role_resource.rb
Overview
Instance Method Summary collapse
-
#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 inherited from Resource
#<=>, #==, all, chef_id, #chef_id, chef_json_class, chef_type, create, delete, delete_all, #eql?, find, find!, #hash, #initialize, #reload, resource_path, #save, set_chef_id, set_chef_json_class, set_chef_type, set_resource_path, #to_s, #update, update
Constructor Details
This class inherits a constructor from Ridley::Resource
Instance Method Details
#set_default_attribute(key, value) ⇒ HashWithIndifferentAccess
Set a role level default attribute given the dotted path representation of the Chef attribute and value
58 59 60 61 |
# File 'lib/ridley/resources/role_resource.rb', line 58 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
40 41 42 43 |
# File 'lib/ridley/resources/role_resource.rb', line 40 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 |