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