Sha256: 0bac43be376766d214c09cbe0b5eb71f37d09e5220f0fb104bf3e7f54fc2f0f5

Contents?: true

Size: 648 Bytes

Versions: 190

Compression:

Stored size: 648 Bytes

Contents

# frozen_string_literal: true

require "active_support/concern"

module Primer
  # :nodoc:
  module Audited
    # DSL to register when a component has passed an accessibility audit.
    #
    # Example:
    #
    # class MyComponent < ViewComponent::Base
    #   include Primer::Audited::Dsl
    #   audited_at 'YYYY-MM-DD'
    # end
    module Dsl
      extend ActiveSupport::Concern

      included do
        class_attribute :audit_date, instance_writer: false
      end

      class_methods do
        def audited_at(date = nil)
          return audit_date if date.nil?

          self.audit_date = date
        end
      end
    end
  end
end

Version data entries

190 entries across 190 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.49.2 app/lib/primer/audited/dsl.rb
primer_view_components-0.35.2 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.49.1 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.49.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.35.1 app/lib/primer/audited/dsl.rb
primer_view_components-0.35.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.48.2 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.48.1 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.48.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.47.1 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.47.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.34.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.46.1 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.46.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.45.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.44.3 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.44.2 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.44.1 app/lib/primer/audited/dsl.rb
primer_view_components-0.33.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.44.0 app/lib/primer/audited/dsl.rb