# class Chef::ChefFS::DataHandler::GroupDataHandler

### Public Instance Methods

chef_class() click to toggle source

    # File lib/chef/chef_fs/data_handler/group_data_handler.rb, line 43
    def chef_class
      Chef::ApiClient
    end

normalize(group, entry) click to toggle source

    # File lib/chef/chef_fs/data_handler/group_data_handler.rb, line 8
    def normalize(group, entry)
      defaults = {
        'name' => remove_dot_json(entry.name),
        'groupname' => remove_dot_json(entry.name),
        'users' => [],
        'clients' => [],
        'groups' => [],
      }
      if entry.org
        defaults['orgname'] = entry.org
      end
      result = normalize_hash(group, defaults)
      if result['actors'] && result['actors'].sort.uniq == (result['users'] + result['clients']).sort.uniq
        result.delete('actors')
      end
      result
    end

normalize_for_put(group, entry) click to toggle source
Calls superclass method Chef::ChefFS::DataHandler::DataHandlerBase#normalize_for_put

    # File lib/chef/chef_fs/data_handler/group_data_handler.rb, line 26
    def normalize_for_put(group, entry)
      result = super(group, entry)
      result['actors'] = {
        'users' => result['users'],
        'clients' => result['clients'],
        'groups' => result['groups']
      }
      result.delete('users')
      result.delete('clients')
      result.delete('groups')
      result
    end

preserve_key(key) click to toggle source

    # File lib/chef/chef_fs/data_handler/group_data_handler.rb, line 39
    def preserve_key(key)
      return key == 'name'
    end