Class: Makit::Configuration::Step

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

Overview

Individual step in a project configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, description:, commands:) ⇒ Step

Returns a new instance of Step.



9
10
11
12
13
14
15
# File 'lib/makit/configuration/step.rb', line 9

def initialize(name:, description:, commands:)
  @name = name
  @description = description
  @commands = commands.is_a?(Array) ? commands : [commands]

  validate_commands
end

Instance Attribute Details

#commandsObject

Returns the value of attribute commands.



7
8
9
# File 'lib/makit/configuration/step.rb', line 7

def commands
  @commands
end

#descriptionObject

Returns the value of attribute description.



7
8
9
# File 'lib/makit/configuration/step.rb', line 7

def description
  @description
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/makit/configuration/step.rb', line 7

def name
  @name
end

Instance Method Details

#to_hObject



17
18
19
20
21
22
23
# File 'lib/makit/configuration/step.rb', line 17

def to_h
  {
    name: @name,
    description: @description,
    commands: @commands,
  }
end