Class: Bocuse::NodeContext

Inherits:
Object
  • Object
show all
Includes:
ContextDelegation
Defined in:
lib/bocuse/node_context.rb

Overview

A context for a node. This wraps the project level context and provides node specific context functions.

Instance Method Summary collapse

Methods included from ContextDelegation

#method_missing, #respond_to?

Constructor Details

#initialize(node_name, context) ⇒ NodeContext

Returns a new instance of NodeContext.



10
11
12
13
# File 'lib/bocuse/node_context.rb', line 10

def initialize(node_name, context)
  @context = context
  @node_name = node_name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Bocuse::ContextDelegation

Instance Method Details

#bocuseObject



15
16
17
# File 'lib/bocuse/node_context.rb', line 15

def bocuse
  @context.bocuse.merge(node_name: @node_name)
end