Sha256: f9e9be6a5666da15f87a1c4c1dd8da7374908290b3f498691ba9be9493c90a54
Contents?: true
Size: 980 Bytes
Versions: 92
Compression:
Stored size: 980 Bytes
Contents
# frozen_string_literal: true module Decidim module ParticipatoryProcesses # This class infers the current component on a participatory process 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 participatory process and a # component belonging to that participatory process, false otherwise def matches?(request) CurrentParticipatoryProcess.new.matches?(request) && Decidim::CurrentComponent.new(@manifest).matches?(request) end end end end
Version data entries
92 entries across 92 versions & 1 rubygems