Class: GeneSystem::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/gene_system/step.rb

Overview

Step is an in memory representation of a manifest step

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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.tags.split("\s") if @data.tags
end

Instance Attribute Details

#tagsObject (readonly)

Returns the value of attribute tags.



21
22
23
# File 'lib/gene_system/step.rb', line 21

def tags
  @tags
end

Class Method Details

.load_steps(steps) ⇒ Array

Loads steps from an array of steps

Parameters:

  • steps (Array)

Returns:

  • (Array)


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

#exeHash

Step execution instructions getter

Returns:

  • (Hash)


52
53
54
# File 'lib/gene_system/step.rb', line 52

def exe
  @data.exe
end

#installArray

Installation instructions getter

Returns:

  • (Array)


61
62
63
# File 'lib/gene_system/step.rb', line 61

def install
  exe.install
end

#nameString

Step name getter

Returns:

  • (String)


34
35
36
# File 'lib/gene_system/step.rb', line 34

def name
  @data.name
end

#promptsArray

Step prompt getter

Returns:

  • (Array)


43
44
45
# File 'lib/gene_system/step.rb', line 43

def prompts
  @data.prompts
end

#removeArray

Removal instructions getter

Returns:

  • (Array)


70
71
72
# File 'lib/gene_system/step.rb', line 70

def remove
  exe.remove
end