Class: Pdadv::Screen

Inherits:
Object
  • Object
show all
Defined in:
lib/pdadv/screen.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil) ⇒ Screen



7
8
9
10
11
12
# File 'lib/pdadv/screen.rb', line 7

def initialize(name = nil)
  @name = name || "id-#{rand(999_999_999)}"
  @back = nil
  @actors = []
  @message = ''
end

Instance Attribute Details

#actorsObject (readonly)

Returns the value of attribute actors.



15
16
17
# File 'lib/pdadv/screen.rb', line 15

def actors
  @actors
end

#backObject

Returns the value of attribute back.



14
15
16
# File 'lib/pdadv/screen.rb', line 14

def back
  @back
end

#messageObject

Returns the value of attribute message.



14
15
16
# File 'lib/pdadv/screen.rb', line 14

def message
  @message
end

#nameObject

Returns the value of attribute name.



14
15
16
# File 'lib/pdadv/screen.rb', line 14

def name
  @name
end

Instance Method Details

#format_message(scenario) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/pdadv/screen.rb', line 17

def format_message(scenario)
  return '' if message.empty?

  text = CGI.escape_html(message)
  text = create_link(scenario, text)

  text
end