# class Chef::ChefFS::DataHandler::EnvironmentDataHandler

### Public Instance Methods

chef_class() click to toggle source

    # File lib/chef/chef_fs/data_handler/environment_data_handler.rb, line 24
    def chef_class
      Chef::Environment
    end

normalize(environment, entry) click to toggle source

    # File lib/chef/chef_fs/data_handler/environment_data_handler.rb, line 8
    def normalize(environment, entry)
      normalize_hash(environment, {
        'name' => remove_dot_json(entry.name),
        'description' => '',
        'cookbook_versions' => {},
        'default_attributes' => {},
        'override_attributes' => {},
        'json_class' => 'Chef::Environment',
        'chef_type' => 'environment'
      })
    end

preserve_key(key) click to toggle source

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

to_ruby(object) click to toggle source

    # File lib/chef/chef_fs/data_handler/environment_data_handler.rb, line 28
    def to_ruby(object)
      result = to_ruby_keys(object, %w(name description default_attributes override_attributes))
      if object['cookbook_versions']
        object['cookbook_versions'].each_pair do |name, version|
          result << "cookbook #{name.inspect}, #{version.inspect}"
        end
      end
      result
    end