Class: MikadoGraph::State
- Inherits:
-
Object
- Object
- MikadoGraph::State
- Defined in:
- lib/mikado_graph/state.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#prerequisite_states ⇒ Object
readonly
Returns the value of attribute prerequisite_states.
Instance Method Summary collapse
-
#initialize(name) ⇒ State
constructor
A new instance of State.
- #to_s ⇒ Object
- #with_prerequisites(&block) ⇒ Object (also: #with_prereqs)
Constructor Details
#initialize(name) ⇒ State
Returns a new instance of State.
5 6 7 8 |
# File 'lib/mikado_graph/state.rb', line 5 def initialize(name) @name = name @prerequisite_states = [] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/mikado_graph/state.rb', line 3 def name @name end |
#prerequisite_states ⇒ Object (readonly)
Returns the value of attribute prerequisite_states.
3 4 5 |
# File 'lib/mikado_graph/state.rb', line 3 def prerequisite_states @prerequisite_states end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/mikado_graph/state.rb', line 17 def to_s name end |
#with_prerequisites(&block) ⇒ Object Also known as: with_prereqs
10 11 12 13 14 |
# File 'lib/mikado_graph/state.rb', line 10 def with_prerequisites(&block) prerequisites = Prerequisites.new prerequisites.instance_eval(&block) @prerequisite_states = prerequisites.states end |