Class: Smartdown::Model::Flow
- Inherits:
-
Object
- Object
- Smartdown::Model::Flow
- Defined in:
- lib/smartdown/model/flow.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #coversheet ⇒ Object
-
#initialize(name, nodes = []) ⇒ Flow
constructor
A new instance of Flow.
- #node(node_name) ⇒ Object
Constructor Details
#initialize(name, nodes = []) ⇒ Flow
Returns a new instance of Flow.
6 7 8 9 |
# File 'lib/smartdown/model/flow.rb', line 6 def initialize(name, nodes = []) @name = name @nodes = nodes end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/smartdown/model/flow.rb', line 4 def name @name end |
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
4 5 6 |
# File 'lib/smartdown/model/flow.rb', line 4 def nodes @nodes end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/smartdown/model/flow.rb', line 19 def ==(other) other.is_a?(self.class) && other.nodes == self.nodes && other.name == self.name end |
#coversheet ⇒ Object
11 12 13 |
# File 'lib/smartdown/model/flow.rb', line 11 def coversheet node(name) end |
#node(node_name) ⇒ Object
15 16 17 |
# File 'lib/smartdown/model/flow.rb', line 15 def node(node_name) @nodes.find {|n| n.name.to_s == node_name.to_s } || raise("Unable to find #{node_name}") end |