Class | Chef::Node::Attribute
In: | lib/chef/node/attribute.rb
Parent: | Object

### Methods

[] []= attribute attribute= attribute? auto_vivifiy auto_vivifiy_on_read? component_has_key? delete delete_from_component determine_value each each_attribute each_key each_pair each_value empty? fetch get_keys get_value has_key? has_value? hash_and_not_cna? include? index inspect key? keys kind_of? length member? method_missing new reset set_type_hash set_value size to_hash value? value_at_current_nesting value_or_descend values

### Included Modules

Enumerable

### Constants

HIDDEN_ATTRIBUES | = | [:@override, :@attribute, :@default, :@normal, :@automatic]

### Attributes

auto_vivifiy_on_read | [RW] |
automatic | [RW] |
current_automatic | [RW] |
current_default | [RW] |
current_normal | [RW] |
current_override | [RW] |
default | [RW] |
normal | [RW] |
override | [RW] |
set_type | [RW] |
set_unless_value_present | [RW] |

### Public Class methods

new(normal, default, override, automatic, state=[])

### Public Instance methods

[](key)
[]=(key, value)
attribute()
attribute=(value)
attribute?(key)

Alias for has_key?

auto_vivifiy(data_hash, key)
auto_vivifiy_on_read?()
component_has_key?(component_attrs,key)
delete(key)
delete_from_component(component_attrs, key)
determine_value(a_value, o_value, n_value, d_value)
each(&block)
each_attribute(&block)
each_key(&block)
each_pair(&block)
each_value(&block)
empty?()
fetch(key, default_value=nil, &block)
get_keys()
get_value(data_hash, key)
has_key?(key)
has_value?(value)
hash_and_not_cna?(to_check)
include?(key)

Alias for has_key?

index(value)
inspect()
key?(key)

Alias for has_key?

keys()
kind_of?(klass)

Writing this method hurts me a little bit.

TODO: Refactor all this stuff so this kind of horror is no longer needed

We have invented a new kind of duck-typing, we call it Madoff typing. We just lie and hope we die before you recognize our scheme. :)

length()

Alias for size

member?(key)

Alias for has_key?

method_missing(symbol, *args)

Fetches or sets the value, depending on if any arguments are given.

#### Fetching

If no arguments are given, fetches the value:

      node.network
      => {network data}

Getters will find either a string or symbol key.

#### Setting

If arguments are given, a value will be set. Both normal setter and DSL style setters are allowed:

      node.foo = "bar"
      node.foo("bar")

Both set node[:foo] = "bar"

reset()

Reset our internal current_nesting_level to the top of every tree

set_type_hash()
set_value(data_hash, key, value)
size()
to_hash()
value?(value)

Alias for has_value?

value_at_current_nesting(component_attrs, key)
value_or_descend(data_hash, key, auto_vivifiy=false)
values()

[Validate]