Class: GeneSystem::Step
- Inherits:
-
Object
- Object
- GeneSystem::Step
- Defined in:
- lib/gene_system/step.rb
Overview
Step is an in memory representation of a manifest step
Instance Attribute Summary collapse
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Class Method Summary collapse
-
.load_steps(steps) ⇒ Array
Loads steps from an array of steps.
Instance Method Summary collapse
-
#exe ⇒ Hash
Step execution instructions getter.
-
#initialize(data) ⇒ Step
constructor
A new instance of Step.
-
#install ⇒ Array
Installation instructions getter.
-
#name ⇒ String
Step name getter.
-
#prompts ⇒ Array
Step prompt getter.
-
#remove ⇒ Array
Removal instructions getter.
Constructor Details
#initialize(data) ⇒ Step
Returns a new instance of Step.
23 24 25 26 27 |
# File 'lib/gene_system/step.rb', line 23 def initialize(data) @data = Hashie::Mash.new(data) @tags = [] @tags = @data..split("\s") if @data. end |
Instance Attribute Details
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
21 22 23 |
# File 'lib/gene_system/step.rb', line 21 def @tags end |
Class Method Details
.load_steps(steps) ⇒ Array
Loads steps from an array of steps
14 15 16 17 18 |
# File 'lib/gene_system/step.rb', line 14 def load_steps(steps) steps.map do |data| new(data) end end |
Instance Method Details
#exe ⇒ Hash
Step execution instructions getter
52 53 54 |
# File 'lib/gene_system/step.rb', line 52 def exe @data.exe end |
#install ⇒ Array
Installation instructions getter
61 62 63 |
# File 'lib/gene_system/step.rb', line 61 def install exe.install end |
#name ⇒ String
Step name getter
34 35 36 |
# File 'lib/gene_system/step.rb', line 34 def name @data.name end |
#prompts ⇒ Array
Step prompt getter
43 44 45 |
# File 'lib/gene_system/step.rb', line 43 def prompts @data.prompts end |
#remove ⇒ Array
Removal instructions getter
70 71 72 |
# File 'lib/gene_system/step.rb', line 70 def remove exe.remove end |