Class: Collavre::Comments::CommandProcessor
- Inherits:
-
Object
- Object
- Collavre::Comments::CommandProcessor
- Defined in:
- app/services/collavre/comments/command_processor.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(comment:, user:) ⇒ CommandProcessor
constructor
A new instance of CommandProcessor.
Constructor Details
#initialize(comment:, user:) ⇒ CommandProcessor
Returns a new instance of CommandProcessor.
4 5 6 7 |
# File 'app/services/collavre/comments/command_processor.rb', line 4 def initialize(comment:, user:) @comment = comment @user = user end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'app/services/collavre/comments/command_processor.rb', line 9 def call command_handlers.each do |command| result = command.call return result if result.present? end nil rescue StandardError => e Rails.logger.error("Comment command processing failed: #{e.}") e. end |