Class: Collavre::Comments::TopicCommand
- Inherits:
-
Object
- Object
- Collavre::Comments::TopicCommand
- Defined in:
- app/services/collavre/comments/topic_command.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(comment:, user:, url_helpers: Collavre::Engine.routes.url_helpers) ⇒ TopicCommand
constructor
A new instance of TopicCommand.
Constructor Details
#initialize(comment:, user:, url_helpers: Collavre::Engine.routes.url_helpers) ⇒ TopicCommand
Returns a new instance of TopicCommand.
4 5 6 7 8 9 |
# File 'app/services/collavre/comments/topic_command.rb', line 4 def initialize(comment:, user:, url_helpers: Collavre::Engine.routes.url_helpers) @comment = comment @user = user @creative = comment.creative.effective_origin @url_helpers = url_helpers end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'app/services/collavre/comments/topic_command.rb', line 11 def call return unless topic_command? create_topic rescue StandardError => e Rails.logger.error("Topic command failed: #{e.}") e. end |