Sha256: 0e82f949416a7357e844a7c3861c87fdc0d07abdd3e0bd7412b149917458c619
Contents?: true
Size: 926 Bytes
Versions: 18
Compression:
Stored size: 926 Bytes
Contents
# frozen_string_literal: true module Decidim module Conferences # This class infers the current component on a conference context # request parameters and injects it into the environment. class CurrentComponent # Public: Initializes the class. # # manifest - The manifest of the component to check against. def initialize(manifest) @manifest = manifest end # Public: Matches the request against a component and injects it into the # environment. # # request - The request that holds the current component relevant information. # # Returns a true if the request matches a conference and a # component belonging to that conference, false otherwise def matches?(request) CurrentConference.new.matches?(request) && Decidim::CurrentComponent.new(@manifest).matches?(request) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems