Class: Journeyviz::Action

Inherits:
Object
  • Object
show all
Includes:
NormalizedName
Defined in:
lib/journeyviz/action.rb

Instance Attribute Summary collapse

Attributes included from NormalizedName

#name

Instance Method Summary collapse

Constructor Details

#initialize(name, screen, transition: nil) ⇒ Action

Returns a new instance of Action.



10
11
12
13
14
# File 'lib/journeyviz/action.rb', line 10

def initialize(name, screen, transition: nil)
  assign_normalize_name(name)
  @screen = screen
  @transition = transition
end

Instance Attribute Details

#screenObject (readonly)

Returns the value of attribute screen.



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

def screen
  @screen
end

Instance Method Details

#raw_transitionObject



23
24
25
# File 'lib/journeyviz/action.rb', line 23

def raw_transition
  @transition
end

#transitionObject



16
17
18
19
20
21
# File 'lib/journeyviz/action.rb', line 16

def transition
  case @transition
  when Symbol then find_screen_by_name(@transition)
  when Array then find_screen_by_full_qualifier(@transition)
  end
end