Class: Orchestra::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/orchestra/node.rb,
lib/orchestra/node/output.rb

Direct Known Subclasses

DelegateNode, InlineNode

Defined Under Namespace

Classes: DelegateNode, InlineNode, Output

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Node

Returns a new instance of Node.



7
8
9
10
11
12
13
14
15
16
# File 'lib/orchestra/node.rb', line 7

def initialize args = {}
  @provisions,
  @collection,
  @dependencies = Util.extract_key_args(
    args,
    :provides      => [],
    :collection    => nil,
    :dependencies  => [],
  )
end

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



5
6
7
# File 'lib/orchestra/node.rb', line 5

def collection
  @collection
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



5
6
7
# File 'lib/orchestra/node.rb', line 5

def dependencies
  @dependencies
end

#provisionsObject (readonly)

Returns the value of attribute provisions.



5
6
7
# File 'lib/orchestra/node.rb', line 5

def provisions
  @provisions
end

Instance Method Details

#collection?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/orchestra/node.rb', line 26

def collection?
  collection ? true : false
end

#optional_dependenciesObject



22
23
24
# File 'lib/orchestra/node.rb', line 22

def optional_dependencies
  defaults.keys
end

#perform(input = {}) ⇒ Object



30
31
32
33
# File 'lib/orchestra/node.rb', line 30

def perform input = {}
  performance = Performance.new Conductor.new, {}, input
  Performance::Movement.perform self, performance
end

#process(raw_output) ⇒ Object



35
36
37
# File 'lib/orchestra/node.rb', line 35

def process raw_output
  Output.process self, raw_output
end

#required_dependenciesObject



18
19
20
# File 'lib/orchestra/node.rb', line 18

def required_dependencies
  dependencies - optional_dependencies
end