Class: Chef::Provider::User::MacUser::Plist

Inherits:
Object
  • Object
show all
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",
    is_hidden: "dsAttrTypeNative:IsHidden",
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plist_hash = {}, property_map = DSCL_PROPERTY_MAP) ⇒ Plist

Returns a new instance of Plist.



654
655
656
657
# File 'lib/chef/provider/user/mac.rb', line 654

def initialize(plist_hash = {}, property_map = DSCL_PROPERTY_MAP)
  @plist_hash = plist_hash
  @property_map = property_map
end

Instance Attribute Details

#plist_hashObject

Returns the value of attribute plist_hash.



652
653
654
# File 'lib/chef/provider/user/mac.rb', line 652

def plist_hash
  @plist_hash
end

#property_mapObject

Returns the value of attribute property_map.



652
653
654
# File 'lib/chef/provider/user/mac.rb', line 652

def property_map
  @property_map
end

Instance Method Details

#get(key) ⇒ Object Also known as: []



659
660
661
662
663
# File 'lib/chef/provider/user/mac.rb', line 659

def get(key)
  return nil unless property_map.key?(key)

  plist_hash[property_map[key]]
end

#set(key, value) ⇒ Object Also known as: []=



666
667
668
669
670
# File 'lib/chef/provider/user/mac.rb', line 666

def set(key, value)
  return nil unless property_map.key?(key)

  plist_hash[property_map[key]] = [ value ]
end