Sha256: 7b40959f4a998328c4d50a849fde0106280209729134915799d3655936d8baa9

Contents?: true

Size: 928 Bytes

Versions: 60

Compression:

Stored size: 928 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Conferences
    # This class infers the current component on an 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 an 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

60 entries across 60 versions & 1 rubygems

Version Path
decidim-conferences-0.27.9 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.27.8 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.27.7 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.27.6 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.26.10 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.26.9 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.27.5 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.26.8 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.27.4 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.27.3 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.26.7 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.26.5 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.27.2 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.27.1 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.26.4 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.27.0 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.26.3 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.27.0.rc2 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.27.0.rc1 app/constraints/decidim/conferences/current_component.rb
decidim-conferences-0.26.2 app/constraints/decidim/conferences/current_component.rb