Module: Gamefic::Messaging

Included in:
Entity
Defined in:
lib/gamefic/messaging.rb

Instance Method Summary collapse

Instance Method Details

#flushObject

Clear the buffered messages.



29
30
31
# File 'lib/gamefic/messaging.rb', line 29

def flush
  @messages = ''
end

#messagesString

Get all the currently buffered messages consolidated in a single string.

Returns:



23
24
25
# File 'lib/gamefic/messaging.rb', line 23

def messages
  @messages ||= ''
end

#stream(message) ⇒ Object

Send a message to the Character as raw text. Unlike #tell, this method will not wrap the message in HTML paragraphs.

Parameters:



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

def stream(message)
  @messages = @messages.to_s + message
end

#tell(message) ⇒ Object

Send a message to the entity. This method will automatically wrap the message in HTML paragraphs. To send a message without paragraph formatting, use #stream instead.

Parameters:



8
9
10
# File 'lib/gamefic/messaging.rb', line 8

def tell(message)
  @messages = @messages.to_s + format(message)
end