# class Chef::ChefFS::DataHandler::CookbookDataHandler

### Public Instance Methods

chef_class() click to toggle source

    # File lib/chef/chef_fs/data_handler/cookbook_data_handler.rb, line 30
    def chef_class
      Chef::Cookbook::Metadata
    end

normalize(cookbook, entry) click to toggle source

    # File lib/chef/chef_fs/data_handler/cookbook_data_handler.rb, line 8
    def normalize(cookbook, entry)
      version = entry.name
      name = entry.parent.name
      result = normalize_hash(cookbook, {
        'name' => "#{name}-#{version}",
        'version' => version,
        'cookbook_name' => name,
        'json_class' => 'Chef::CookbookVersion',
        'chef_type' => 'cookbook_version',
        'frozen?' => false,
        'metadata' => {}
      })
      result['metadata'] = normalize_hash(result['metadata'], {
        'version' => version,
        'name' => name
      })
    end

preserve_key(key) click to toggle source

    # File lib/chef/chef_fs/data_handler/cookbook_data_handler.rb, line 26
    def preserve_key(key)
      return key == 'cookbook_name' || key == 'version'
    end