Module: Gamefic::Messaging
- Included in:
- Entity
- Defined in:
- lib/gamefic/messaging.rb
Instance Method Summary collapse
-
#flush ⇒ Object
Clear the buffered messages.
-
#messages ⇒ String
Get all the currently buffered messages consolidated in a single string.
-
#stream(message) ⇒ Object
Send a message to the Character as raw text.
-
#tell(message) ⇒ Object
Send a message to the entity.
Instance Method Details
#flush ⇒ Object
Clear the buffered messages.
29 30 31 |
# File 'lib/gamefic/messaging.rb', line 29 def flush @messages = '' end |
#messages ⇒ String
Get all the currently buffered messages consolidated in a single string.
23 24 25 |
# File 'lib/gamefic/messaging.rb', line 23 def @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.
16 17 18 |
# File 'lib/gamefic/messaging.rb', line 16 def stream() @messages = @messages.to_s + 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.
8 9 10 |
# File 'lib/gamefic/messaging.rb', line 8 def tell() @messages = @messages.to_s + format() end |