Class: Riddler::UseCases::DismissInteraction
- Inherits:
-
Object
- Object
- Riddler::UseCases::DismissInteraction
- Defined in:
- lib/riddler/use_cases/dismiss_interaction.rb
Instance Attribute Summary collapse
-
#interaction ⇒ Object
readonly
Returns the value of attribute interaction.
-
#interaction_id ⇒ Object
readonly
Returns the value of attribute interaction_id.
-
#interaction_repo ⇒ Object
readonly
Returns the value of attribute interaction_repo.
Instance Method Summary collapse
-
#initialize(interaction_repo:, interaction_id:) ⇒ DismissInteraction
constructor
A new instance of DismissInteraction.
- #process ⇒ Object
Constructor Details
#initialize(interaction_repo:, interaction_id:) ⇒ DismissInteraction
Returns a new instance of DismissInteraction.
6 7 8 9 |
# File 'lib/riddler/use_cases/dismiss_interaction.rb', line 6 def initialize interaction_repo:, interaction_id: @interaction_repo = interaction_repo @interaction_id = interaction_id end |
Instance Attribute Details
#interaction ⇒ Object (readonly)
Returns the value of attribute interaction.
4 5 6 |
# File 'lib/riddler/use_cases/dismiss_interaction.rb', line 4 def interaction @interaction end |
#interaction_id ⇒ Object (readonly)
Returns the value of attribute interaction_id.
4 5 6 |
# File 'lib/riddler/use_cases/dismiss_interaction.rb', line 4 def interaction_id @interaction_id end |
#interaction_repo ⇒ Object (readonly)
Returns the value of attribute interaction_repo.
4 5 6 |
# File 'lib/riddler/use_cases/dismiss_interaction.rb', line 4 def interaction_repo @interaction_repo end |
Instance Method Details
#process ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/riddler/use_cases/dismiss_interaction.rb', line 11 def process @interaction = interaction_repo.find_by id: interaction_id return if interaction.nil? interaction.dismiss interaction_repo.update interaction end |