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", is_hidden: "dsAttrTypeNative:IsHidden", }.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.
645 646 647 648 |
# File 'lib/chef/provider/user/mac.rb', line 645 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.
643 644 645 |
# File 'lib/chef/provider/user/mac.rb', line 643 def plist_hash @plist_hash end |
#property_map ⇒ Object
Returns the value of attribute property_map.
643 644 645 |
# File 'lib/chef/provider/user/mac.rb', line 643 def property_map @property_map end |
Instance Method Details
#get(key) ⇒ Object Also known as: []
650 651 652 653 654 |
# File 'lib/chef/provider/user/mac.rb', line 650 def get(key) return nil unless property_map.key?(key) plist_hash[property_map[key]] end |
#set(key, value) ⇒ Object Also known as: []=
657 658 659 660 661 |
# File 'lib/chef/provider/user/mac.rb', line 657 def set(key, value) return nil unless property_map.key?(key) plist_hash[property_map[key]] = [ value ] end |