Class: Chef::Provider::User::MacUser::Plist
- Inherits:
-
Object
- Object
- Chef::Provider::User::MacUser::Plist
- Defined in:
- lib/chef/provider/user/mac.rb
Constant Summary collapse
- DSCL_PROPERTY_MAP =
{ uid: "dsAttrTypeStandard:UniqueID", guid: "dsAttrTypeStandard:GeneratedUID", gid: "dsAttrTypeStandard:PrimaryGroupID", home: "dsAttrTypeStandard:NFSHomeDirectory", shell: "dsAttrTypeStandard:UserShell", comment: "dsAttrTypeStandard:RealName", password: "dsAttrTypeStandard:Password", auth_authority: "dsAttrTypeStandard:AuthenticationAuthority", shadow_hash: "dsAttrTypeNative:ShadowHashData", group_members: "dsAttrTypeStandard:GroupMembers", }.freeze
Instance Attribute Summary collapse
-
#plist_hash ⇒ Object
Returns the value of attribute plist_hash.
-
#property_map ⇒ Object
Returns the value of attribute property_map.
Instance Method Summary collapse
- #get(key) ⇒ Object (also: #[])
-
#initialize(plist_hash = {}, property_map = DSCL_PROPERTY_MAP) ⇒ Plist
constructor
A new instance of Plist.
- #set(key, value) ⇒ Object (also: #[]=)
Constructor Details
#initialize(plist_hash = {}, property_map = DSCL_PROPERTY_MAP) ⇒ Plist
Returns a new instance of Plist.
600 601 602 603 |
# File 'lib/chef/provider/user/mac.rb', line 600 def initialize(plist_hash = {}, property_map = DSCL_PROPERTY_MAP) @plist_hash = plist_hash @property_map = property_map end |
Instance Attribute Details
#plist_hash ⇒ Object
Returns the value of attribute plist_hash.
598 599 600 |
# File 'lib/chef/provider/user/mac.rb', line 598 def plist_hash @plist_hash end |
#property_map ⇒ Object
Returns the value of attribute property_map.
598 599 600 |
# File 'lib/chef/provider/user/mac.rb', line 598 def property_map @property_map end |
Instance Method Details
#get(key) ⇒ Object Also known as: []
605 606 607 608 609 |
# File 'lib/chef/provider/user/mac.rb', line 605 def get(key) return nil unless property_map.key?(key) plist_hash[property_map[key]] end |
#set(key, value) ⇒ Object Also known as: []=
612 613 614 615 616 |
# File 'lib/chef/provider/user/mac.rb', line 612 def set(key, value) return nil unless property_map.key?(key) plist_hash[property_map[key]] = [ value ] end |