Skip to content

Commit

Permalink
Improved documentation for the print_value helper method
Browse files Browse the repository at this point in the history
Closes #169
  • Loading branch information
karmi committed Dec 5, 2013
1 parent beced61 commit 1ad0f5c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libraries/print_value.rb
Expand Up @@ -7,19 +7,19 @@ module Templates
#
# 1. Using the key as a node attribute:
#
# <%= print_value 'bar' -%> is evaluated as: `node[:bar]`
# <%= print_value 'bar' -%> is evaluated as: `node.elasticsearch[:bar]`
#
# You may use a dot-separated key for nested attributes:
#
# <%= print_value 'foo.bar' -%> is evaluated in multiple ways in this order:
#
# a) as `node['foo.bar']`,
# b) as `node['foo_bar']`,
# c) as `node.foo.bar` (ie. `node[:foo][:bar]`)
# a) as `node.elasticsearch['foo.bar']`,
# b) as `node.elasticsearch['foo_bar']`,
# c) as `node.elasticsearch.foo.bar` (ie. `node.elasticsearch[:foo][:bar]`)
#
# 2. You may also provide an explicit value for the method, which is then used:
#
# <%= print_value 'bar', node[:foo] -%>
# <%= print_value 'bar', node.elasticsearch[:foo] -%>
#
# You may pass a specific separator to the method:
#
Expand Down

0 comments on commit 1ad0f5c

Please sign in to comment.