Class: Undead::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/undead/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, *args) ⇒ Command

Returns a new instance of Command.



10
11
12
13
14
# File 'lib/undead/command.rb', line 10

def initialize(name, *args)
  @id = SecureRandom.uuid
  @name = name
  @args = args
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



8
9
10
# File 'lib/undead/command.rb', line 8

def args
  @args
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/undead/command.rb', line 6

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/undead/command.rb', line 7

def name
  @name
end

Instance Method Details

#messageObject



16
17
18
# File 'lib/undead/command.rb', line 16

def message
  JSON.dump({ 'id' => @id, 'name' => @name, 'args' => @args })
end