Class: SpecForge::Forge::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/spec_forge/forge/action.rb

Overview

Base class for step actions

Actions are the executable units within a step. Each action type (Call, Debug, Expect, Request, Store) inherits from this base class and implements the run method to perform its specific behavior.

Direct Known Subclasses

Call, Debug, Expect, Request, Store

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(step) ⇒ Action

Creates a new action for the given step

Parameters:

  • step (Step)

    The step this action belongs to



23
24
25
# File 'lib/spec_forge/forge/action.rb', line 23

def initialize(step)
  @step = step
end

Instance Attribute Details

#stepStep (readonly)

Returns The step being executed.

Returns:

  • (Step)

    The step being executed



14
15
16
# File 'lib/spec_forge/forge/action.rb', line 14

def step
  @step
end

Instance Method Details

#run(_forge) ⇒ void

This method returns an undefined value.

Executes the action

Parameters:

  • _forge (Forge)

    The forge instance executing this action

Raises:

  • (RuntimeError)

    If not implemented by subclass



36
37
38
# File 'lib/spec_forge/forge/action.rb', line 36

def run(_forge)
  raise "not implemented"
end