Sha256: a5b984af2231063bb3011163fc54b79265fbc8d7186709a0762db25eec9e6681
Contents?: true
Size: 976 Bytes
Versions: 23
Compression:
Stored size: 976 Bytes
Contents
# frozen_string_literal: true module Decidim module DecidimAwesome module ContextAnalyzers # Translates a decidim participatory_space to detected participatory spaces class ParticipatorySpaceAnalyzer def initialize(participatory_space) @participatory_space = participatory_space @context = {} end def self.context_for(participatory_space) analyzer = new participatory_space analyzer.extract_context! analyzer.context end attr_reader :participatory_space, :context def extract_context! return unless @participatory_space.respond_to? :manifest return unless @participatory_space.manifest.is_a? Decidim::ParticipatorySpaceManifest @context[:participatory_space_manifest] = @participatory_space.manifest.name.to_s @context[:participatory_space_slug] = @participatory_space&.slug end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems