Class: Chat::DotCommand::Validator
- Inherits:
-
Object
- Object
- Chat::DotCommand::Validator
- Defined in:
- app/models/chat/dot_command/validator.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
- #commands ⇒ Object
- #custom_commands ⇒ Object
-
#initialize(command) ⇒ Validator
constructor
A new instance of Validator.
- #perform ⇒ Object
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
#command ⇒ Object (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
#commands ⇒ Object
16 17 18 |
# File 'app/models/chat/dot_command/validator.rb', line 16 def commands %w(.gif .shrug) end |
#custom_commands ⇒ Object
20 21 22 |
# File 'app/models/chat/dot_command/validator.rb', line 20 def custom_commands [] end |
#perform ⇒ Object
12 13 14 |
# File 'app/models/chat/dot_command/validator.rb', line 12 def perform (commands + custom_commands).include? command end |