class Pantry::Commands::Echo

Simple Echo command, returns the body of the Message given.

Public Class Methods

new(string_to_echo = "") click to toggle source
# File lib/pantry/commands/echo.rb, line 11
def initialize(string_to_echo = "")
  @string_to_echo = string_to_echo
end

Public Instance Methods

perform(message) click to toggle source
# File lib/pantry/commands/echo.rb, line 21
def perform(message)
  message.body[0]
end
receive_client_response(response) click to toggle source
# File lib/pantry/commands/echo.rb, line 25
def receive_client_response(response)
  Pantry.ui.say("#{response.from} echo's #{response.body[0].inspect}")
end
to_message() click to toggle source
Calls superclass method Pantry::Command#to_message
# File lib/pantry/commands/echo.rb, line 15
def to_message
  message = super
  message << @string_to_echo
  message
end