Class: Sankey::Reagent
- Inherits:
-
Object
- Object
- Sankey::Reagent
- Defined in:
- lib/reagent.rb
Instance Attribute Summary collapse
-
#drain ⇒ Object
Returns the value of attribute drain.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #add_drain(process, order = nil) ⇒ Object
- #add_source(process, order = nil) ⇒ Object
-
#initialize(size, name = '') ⇒ Reagent
constructor
A new instance of Reagent.
- #joins_later ⇒ Object
Constructor Details
#initialize(size, name = '') ⇒ Reagent
Returns a new instance of Reagent.
5 6 7 8 |
# File 'lib/reagent.rb', line 5 def initialize(size, name = '') @size = size @name = name end |
Instance Attribute Details
#drain ⇒ Object
Returns the value of attribute drain.
3 4 5 |
# File 'lib/reagent.rb', line 3 def drain @drain end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/reagent.rb', line 3 def name @name end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
3 4 5 |
# File 'lib/reagent.rb', line 3 def size @size end |
#source ⇒ Object
Returns the value of attribute source.
3 4 5 |
# File 'lib/reagent.rb', line 3 def source @source end |
Instance Method Details
#add_drain(process, order = nil) ⇒ Object
20 21 22 23 |
# File 'lib/reagent.rb', line 20 def add_drain(process, order = nil) process.add_input self, order @drain = process end |
#add_source(process, order = nil) ⇒ Object
25 26 27 28 |
# File 'lib/reagent.rb', line 25 def add_source(process, order = nil) process.add_output self, order @source= process end |
#joins_later ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/reagent.rb', line 30 def joins_later drain.input.each do |r| next if r == self if r.source != nil return true end end false end |