Module: AASMMermaid

Defined in:
lib/aasm_mermaid.rb,
lib/aasm_mermaid/event.rb,
lib/aasm_mermaid/diagram.rb,
lib/aasm_mermaid/version.rb,
lib/aasm_mermaid/transition.rb

Overview

Mermaid diagrams from AASM state machines

Examples:

generate a Mermaid diagram

AASMMermaid.generate_diagram_for(aasm: SomeClass.aasm)

Defined Under Namespace

Classes: Diagram, Event, Transition

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.generate_diagram_for(aasm:) ⇒ String

Returns Mermaid diagram string.

Parameters:

  • aasm (AASM::Base)

    aasm instance

Returns:

  • (String)

    Mermaid diagram string



16
17
18
# File 'lib/aasm_mermaid.rb', line 16

def self.generate_diagram_for(aasm:)
  Diagram.new(aasm: aasm).generate
end