class Aggro::Message::Command
Public: Command
message.
Constants
- TYPE_CODE
Public Class Methods
parse(string)
click to toggle source
# File lib/aggro/message/command.rb, line 7 def self.parse(string) new string[2..37], string[38..73], parse_details(string[74..-1]) end
parse_details(details)
click to toggle source
# File lib/aggro/message/command.rb, line 11 def self.parse_details(details) Marshal.load details end
Public Instance Methods
args()
click to toggle source
# File lib/aggro/message/command.rb, line 15 def args details[:args] end
command_class()
click to toggle source
# File lib/aggro/message/command.rb, line 19 def command_class ActiveSupport::Inflector.safe_constantize name end
name()
click to toggle source
# File lib/aggro/message/command.rb, line 23 def name details[:name] end
to_command()
click to toggle source
# File lib/aggro/message/command.rb, line 27 def to_command command_class.new args if command_class end
to_s()
click to toggle source
# File lib/aggro/message/command.rb, line 31 def to_s "#{TYPE_CODE}#{sender}#{commandee_id}#{Marshal.dump details}" end