Method: Plant::Core::ClassMethods#get_node_content
- Defined in:
- lib/plant/core.rb
#get_node_content(node_id, options = {}) ⇒ Object
Convenience method to get the content of a given node
=> Paramter: node ID (string)
=> Paramter: Options (hash)
- scenario
Can either be a string or an object with
a scenario method, for example a user
- Also can be any arbitary key to be injected into the
returned content. For example
When called get_node_content(node_id, foo: 'hhh)
"This is content for #{foo} and bar"
will return 'This is content for hhh and bar'
Note: If second parameter is a string, it will be treated as
scenario.
Also see: get_node
51 52 53 54 55 |
# File 'lib/plant/core.rb', line 51 def get_node_content(node_id, = {}) = { scenario: } unless .is_a? Hash = defaults.merge() inject_content(get_node(node_id, ).content, ) end |