Module | Chef::Mixin::Language
In: | lib/chef/mixin/language.rb

### Methods

data_bag data_bag_item platform? platform_family? search value_for_platform value_for_platform_family

### Classes and Modules

Class Chef::Mixin::Language::PlatformDependentValue
Class Chef::Mixin::Language::PlatformFamilyDependentValue

### Public Instance methods

data_bag(bag)
data_bag_item(bag, item)
platform?(*args)

Given a list of platforms, returns true if the current recipe is being run on a node with that platform, false otherwise.

### Parameters

args: | A list of platforms. Each platform can be in string or symbol format.

### Returns

true: | If the current platform is in the list
false: | If the current platform is not in the list

platform_family?(*args)

Given a list of platform families, returns true if the current recipe is being run on a node within that platform family, false otherwise.

### Parameters

args: | A list of platform families. Each platform family can be in string or symbol format.

### Returns

true: | if the current node platform family is in the list.
false: | if the current node platform family is not in the list.

search(*args, &block)
value_for_platform(platform_hash)

Given a hash similar to the one we use for Platforms, select a value from the hash. Supports per platform defaults, along with a single base default. Arrays may be passed as hash keys and will be expanded.

### Parameters

platform_hash: | A platform-style hash.

### Returns

value: | Whatever the most specific value of the hash is.

value_for_platform_family(platform_family_hash)

Given a hash mapping platform families to values, select a value from the hash. Supports a single base default if platform family is not in the map. Arrays may be passed as hash keys and will be expanded.

### Parameters

platform_family_hash: | A hash in the form { platform_family_name => value }

### Returns

value: | Whatever the most specific value of the hash is.

[Validate]