Method: Riddler::UseCases::ShowSlug#process

Defined in:
lib/riddler/use_cases/show_slug.rb

#processObject



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/riddler/use_cases/show_slug.rb', line 50

def process
  find_interaction || create_interaction
  context.assign "interaction", interaction.to_hash

  content_hash = definition_use_case.process.merge \
    interaction_id: interaction.id,
    dismiss_url: "/interactions/#{interaction.id}/dismiss"

  interaction.content_type = content_hash[:content_type]
  interaction.content_id = content_hash[:id]

  interaction_repo.update interaction

  content_hash
end