Sha256: b393475251cad7c2808b26b70d4902cbea2bf374e7c7653c88dece7932c2efa5

Contents?: true

Size: 633 Bytes

Versions: 14

Compression:

Stored size: 633 Bytes

Contents

# frozen_string_literal: true

module Arclight
  # Render access information for a document
  class AccessComponent < ViewComponent::Base
    def initialize(presenter:)
      super
      @show_config = presenter.configuration.show
      @presenter = presenter
    end

    attr_reader :presenter, :show_config

    delegate :collection?, to: :presenter

    # @return Array<Symbol> a list of metadata section names
    def section_names
      return Array(collection_access_items) if collection?

      Array(component_access_items)
    end

    delegate :collection_access_items, :component_access_items, to: :show_config
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
arclight-1.4.0 app/components/arclight/access_component.rb
arclight-1.3.0 app/components/arclight/access_component.rb
arclight-1.2.0 app/components/arclight/access_component.rb
arclight-1.1.3 app/components/arclight/access_component.rb
arclight-1.1.2 app/components/arclight/access_component.rb
arclight-1.1.1 app/components/arclight/access_component.rb
arclight-1.1.0 app/components/arclight/access_component.rb
arclight-1.0.1 app/components/arclight/access_component.rb
arclight-1.0.0 app/components/arclight/access_component.rb
arclight-1.0.0.beta6 app/components/arclight/access_component.rb
arclight-1.0.0.beta4 app/components/arclight/access_component.rb
arclight-1.0.0.beta3 app/components/arclight/access_component.rb
arclight-1.0.0.beta2 app/components/arclight/access_component.rb
arclight-1.0.0.beta1 app/components/arclight/access_component.rb