Sha256: e47acb16a04d504df00a277fde78ffcef6a261666842aac50303c1625357c6e1
Contents?: true
Size: 905 Bytes
Versions: 34
Compression:
Stored size: 905 Bytes
Contents
# frozen_string_literal: true module Decidim module Assemblies # This class infers the current feature on an assembly context # request parameters and injects it into the environment. class CurrentFeature # Public: Initializes the class. # # manifest - The manifest of the feature to check against. def initialize(manifest) @manifest = manifest end # Public: Matches the request against a feature and injects it into the # environment. # # request - The request that holds the current feature relevant information. # # Returns a true if the request matches an assembly and a # feature belonging to that assembly, false otherwise def matches?(request) CurrentAssembly.new.matches?(request) && Decidim::CurrentFeature.new(@manifest).matches?(request) end end end end
Version data entries
34 entries across 34 versions & 2 rubygems