Class: Diagrams::Elements::Transition

Inherits:
Dry::Struct
  • Object
show all
Includes:
Types
Defined in:
lib/diagrams/elements/transition.rb

Overview

Represents a transition between two states in a State Diagram.

Instance Method Summary collapse

Instance Method Details

#to_hHash{Symbol => String | nil}

Returns a hash representation suitable for serialization.

Returns:

  • (Hash{Symbol => String | nil})


21
22
23
24
# File 'lib/diagrams/elements/transition.rb', line 21

def to_h
  # Start with Dry::Struct's hash and drop nil attributes.
  super.compact
end