Class: Lita::Alias::AliasedCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/lita/alias/aliased_command.rb

Overview

A single aliased command

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, command = nil) ⇒ AliasedCommand

Returns a new instance of AliasedCommand.



7
8
9
10
# File 'lib/lita/alias/aliased_command.rb', line 7

def initialize(name = nil, command = nil)
  @name = name
  @command = command
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



5
6
7
# File 'lib/lita/alias/aliased_command.rb', line 5

def command
  @command
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/lita/alias/aliased_command.rb', line 5

def name
  @name
end

Instance Method Details

#valid?Boolean

Returns true if the object is valid. False otherwise

Returns:

  • (Boolean)

    Boolean



14
15
16
17
# File 'lib/lita/alias/aliased_command.rb', line 14

def valid?
  # for now, just validate the name and command are not nil
  @name && @command
end