Method: Andromeda::Cmd::Cmd#initialize

Defined in:
lib/andromeda/cmd.rb

#initialize(cmd, data = {}, cmd_time = nil) ⇒ Cmd

Returns a new instance of Cmd.

Raises:

  • (ArgumentError)


10
11
12
13
14
15
16
# File 'lib/andromeda/cmd.rb', line 10

def initialize(cmd, data = {}, cmd_time = nil)
  raise ArgumentError unless cmd.kind_of?(Symbol)
  @cmd     = cmd
  @data    = data
  @time    = if cmd_time then cmd_time else Time.now.to_i end
  @comment = nil
end