Class: Vigilem::Core::Pipeline

Inherits:
Object
  • Object
show all
Extended by:
Support::ObjSpace
Defined in:
lib/vigilem/core/pipeline.rb

Overview

observer of components and thier connections the catch is that input_systems don;t have an entry point for determining thier source

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(device) ⇒ Pipeline

Returns a new instance of Pipeline.

Parameters:

  • device (#link)

    most likely a Core::Device



12
13
14
15
# File 'lib/vigilem/core/pipeline.rb', line 12

def initialize(device)
  @device = device
  rebuild
end

Instance Attribute Details

#deviceObject (readonly)

Returns the value of attribute device.



8
9
10
# File 'lib/vigilem/core/pipeline.rb', line 8

def device
  @device
end

Instance Method Details

#changed?TrueClass || FalseClass

checks whether or not this item changed

Returns:

  • (TrueClass || FalseClass)


53
54
55
# File 'lib/vigilem/core/pipeline.rb', line 53

def changed?
  @changed ||= false
end

#rebuildArray

rebuilds the cache

Returns:

  • (Array)


35
36
37
38
39
40
41
42
# File 'lib/vigilem/core/pipeline.rb', line 35

def rebuild
  ary = [device]
  while current = succ
    ary << current
  end
  reset_iter
  cache = ary
end

#reset_iter#source

the start of the pipeline

Returns:

  • (#source)


29
30
31
# File 'lib/vigilem/core/pipeline.rb', line 29

def reset_iter
  @iter = device
end

#succObject

get the next item that #source is pointing to

Returns:



22
23
24
25
# File 'lib/vigilem/core/pipeline.rb', line 22

def succ
  @iter ||= device
  @iter.respond(:source)
end

#to_aArray Also known as: to_ary

Returns all the components in the pipeline.

Returns:

  • (Array)

    all the components in the pipeline



58
59
60
# File 'lib/vigilem/core/pipeline.rb', line 58

def to_a
  changed? ? rebuild : cache
end

#updateTrueClass

updates the status called when a component changes it’s sauce

Returns:

  • (TrueClass)


47
48
49
# File 'lib/vigilem/core/pipeline.rb', line 47

def update
  @changed = true
end