module Gamefic::Active::Messaging

A module for active entities that provides a default Messenger with a few shortcuts.

Public Instance Methods

buffer(&block) click to toggle source
# File lib/gamefic/active/messaging.rb, line 37
def buffer &block
  messenger.buffer(&block)
end
flush() click to toggle source
# File lib/gamefic/active/messaging.rb, line 41
def flush
  messenger.flush
end
messages() click to toggle source
# File lib/gamefic/active/messaging.rb, line 33
def messages
  messenger.messages
end
messenger() click to toggle source

@return [Messenger]

# File lib/gamefic/active/messaging.rb, line 10
def messenger
  @messenger ||= Messenger.new
end
stream(message) click to toggle source

Send a message to the entity as raw text.

Unlike tell, this method will not wrap the message in HTML paragraphs.

@param message [String]

# File lib/gamefic/active/messaging.rb, line 29
def stream(message)
  messenger.stream message
end
tell(message) click to toggle source

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]

# File lib/gamefic/active/messaging.rb, line 20
def tell(message)
  messenger.tell message
end