Class: Chat::DotCommand::Validator

Inherits:
Object
  • Object
show all
Defined in:
app/models/chat/dot_command/validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Validator

Returns a new instance of Validator.



8
9
10
# File 'app/models/chat/dot_command/validator.rb', line 8

def initialize(command)
  @command = command
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



6
7
8
# File 'app/models/chat/dot_command/validator.rb', line 6

def command
  @command
end

Instance Method Details

#commandsObject



16
17
18
# File 'app/models/chat/dot_command/validator.rb', line 16

def commands
  %w(.gif .shrug)
end

#custom_commandsObject



20
21
22
# File 'app/models/chat/dot_command/validator.rb', line 20

def custom_commands
  []
end

#performObject



12
13
14
# File 'app/models/chat/dot_command/validator.rb', line 12

def perform
  (commands + custom_commands).include? command
end