module Gamefic::Active::Messaging
A module for active entities that provides a default Messenger
with a few shortcuts.
Public Instance Methods
Source
# File lib/gamefic/active/messaging.rb, line 42 def buffer &block messenger.buffer(&block) end
Create a temporary buffer while yielding the given block and return the buffered text.
@return [String]
Source
# File lib/gamefic/active/messaging.rb, line 49 def flush messenger.flush end
Clear the current buffer.
@return [String] The buffer’s messages
Source
# File lib/gamefic/active/messaging.rb, line 34 def messages messenger.messages end
@return [String]
Source
# File lib/gamefic/active/messaging.rb, line 10 def messenger @messenger ||= Messenger.new end
@return [Messenger]
Source
# File lib/gamefic/active/messaging.rb, line 29 def stream(message) messenger.stream message end
Send a message to the entity as raw text.
Unlike tell
, this method will not wrap the message in HTML paragraphs.
@param message [String]
Source
# File lib/gamefic/active/messaging.rb, line 20 def tell(message) messenger.tell message end
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.
@param message [String]