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.43.1 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.43.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.32.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.42.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.31.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.41.1 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.41.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.40.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.30.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.39.1 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.39.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.38.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.29.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.28.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.37.1 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.37.0 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.36.2 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.36.1 app/lib/primer/audited/dsl.rb
openproject-primer_view_components-0.36.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.27.0 app/lib/primer/audited/dsl.rb