Class: Vigilem::Core::Pipeline
- Inherits:
-
Object
- Object
- Vigilem::Core::Pipeline
- 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
-
#device ⇒ Object
readonly
Returns the value of attribute device.
Instance Method Summary collapse
-
#changed? ⇒ TrueClass || FalseClass
checks whether or not this item changed.
-
#initialize(device) ⇒ Pipeline
constructor
A new instance of Pipeline.
-
#rebuild ⇒ Array
rebuilds the cache.
-
#reset_iter ⇒ #source
the start of the pipeline.
-
#succ ⇒ Object
get the next item that #source is pointing to.
-
#to_a ⇒ Array
(also: #to_ary)
All the components in the pipeline.
-
#update ⇒ TrueClass
updates the status called when a component changes it’s sauce.
Constructor Details
#initialize(device) ⇒ Pipeline
Returns a new instance of Pipeline.
12 13 14 15 |
# File 'lib/vigilem/core/pipeline.rb', line 12 def initialize(device) @device = device rebuild end |
Instance Attribute Details
#device ⇒ Object (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
53 54 55 |
# File 'lib/vigilem/core/pipeline.rb', line 53 def changed? @changed ||= false end |
#rebuild ⇒ Array
rebuilds the cache
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
29 30 31 |
# File 'lib/vigilem/core/pipeline.rb', line 29 def reset_iter @iter = device end |
#succ ⇒ Object
get the next item that #source is pointing to
22 23 24 25 |
# File 'lib/vigilem/core/pipeline.rb', line 22 def succ @iter ||= device @iter.respond(:source) end |
#to_a ⇒ Array Also known as: to_ary
Returns all the components in the pipeline.
58 59 60 |
# File 'lib/vigilem/core/pipeline.rb', line 58 def to_a changed? ? rebuild : cache end |
#update ⇒ TrueClass
updates the status called when a component changes it’s sauce
47 48 49 |
# File 'lib/vigilem/core/pipeline.rb', line 47 def update @changed = true end |