Class: Super::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/super/action.rb,
lib/super/action/step.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(steps:, page:) ⇒ Action



3
4
5
6
# File 'lib/super/action.rb', line 3

def initialize(steps:, page:)
  @steps = steps
  @page = page
end

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page.



8
9
10
# File 'lib/super/action.rb', line 8

def page
  @page
end

Class Method Details

.stepsObject



3
4
5
# File 'lib/super/action/step.rb', line 3

def self.steps
  @steps ||= {}
end

Instance Method Details

#stepsObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/super/action.rb', line 10

def steps
  resolved_steps = @steps.map do |step|
    if step.respond_to?(:call)
      step
    elsif self.class.steps.key?(step)
      self.class.steps[step]
    end
  end

  resolved_steps.compact
end