Class: Plutonium::Wizard::ReviewStep

Inherits:
Step
  • Object
show all
Defined in:
lib/plutonium/wizard/review_step.rb

Overview

The built-in terminal review step (§2.5). Declares no fields of its own; auto-summarizes collected data and gates Finish → execute. Must be the last declared step.

Defined Under Namespace

Classes: EmptyFields

Instance Attribute Summary collapse

Attributes inherited from Step

#condition, #description, #fields, #key, #label, #on_rollback, #on_submit, #using_spec

Instance Method Summary collapse

Methods inherited from Step

#attribute_options, #attribute_schema, #form_layout, #imported_form_validators, #imported_validate_fn, #inputs, #structured_inputs, #validations

Constructor Details

#initialize(key: :review, label: "Review", description: nil, condition: nil, summary: true, header: true, block: nil) ⇒ ReviewStep

Returns a new instance of ReviewStep.



30
31
32
33
34
35
# File 'lib/plutonium/wizard/review_step.rb', line 30

def initialize(key: :review, label: "Review", description: nil, condition: nil, summary: true, header: true, block: nil)
  super(key:, label:, description:, condition:, fields: EmptyFields.new)
  @summary = summary
  @header = header
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



28
29
30
# File 'lib/plutonium/wizard/review_step.rb', line 28

def block
  @block
end

#headerObject (readonly)

Returns the value of attribute header.



28
29
30
# File 'lib/plutonium/wizard/review_step.rb', line 28

def header
  @header
end

#summaryObject (readonly)

Returns the value of attribute summary.



28
29
30
# File 'lib/plutonium/wizard/review_step.rb', line 28

def summary
  @summary
end

Instance Method Details

#header?Boolean

Whether the step-header section (label + prompt) renders above the review body (see the review header: macro).

Returns:

  • (Boolean)


45
# File 'lib/plutonium/wizard/review_step.rb', line 45

def header? = @header

#review?Boolean

Returns:

  • (Boolean)


37
# File 'lib/plutonium/wizard/review_step.rb', line 37

def review? = true

#summary?Boolean

Whether the auto-summary of completed steps renders in the COMPLETE state (see the review summary: macro). Always true in the incomplete state.

Returns:

  • (Boolean)


41
# File 'lib/plutonium/wizard/review_step.rb', line 41

def summary? = @summary