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