Class: AASMMermaid::Transition

Inherits:
Object
  • Object
show all
Defined in:
lib/aasm_mermaid/transition.rb

Overview

Represents a diagram transition row

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from:, to:, event_name:) ⇒ Transition



12
13
14
15
16
# File 'lib/aasm_mermaid/transition.rb', line 12

def initialize(from:, to:, event_name:)
  self.from = from
  self.to = to
  self.event_name = event_name
end

Instance Attribute Details

#event_nameObject

Returns the value of attribute event_name.



7
8
9
# File 'lib/aasm_mermaid/transition.rb', line 7

def event_name
  @event_name
end

#fromObject

Returns the value of attribute from.



7
8
9
# File 'lib/aasm_mermaid/transition.rb', line 7

def from
  @from
end

#toObject

Returns the value of attribute to.



7
8
9
# File 'lib/aasm_mermaid/transition.rb', line 7

def to
  @to
end

Instance Method Details

#==(other) ⇒ true, false



19
20
21
# File 'lib/aasm_mermaid/transition.rb', line 19

def ==(other)
  from.to_s == other.from.to_s && to.to_s == other.to.to_s && event_name == other.event_name
end

#to_diagram_stringString



24
25
26
# File 'lib/aasm_mermaid/transition.rb', line 24

def to_diagram_string
  "  #{from} --> #{to} : #{event_name}"
end