Sha256: 0bac43be376766d214c09cbe0b5eb71f37d09e5220f0fb104bf3e7f54fc2f0f5

Contents?: true

Size: 648 Bytes

Versions: 202

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

202 entries across 202 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.6.3 app/lib/primer/audited/dsl.rb
primer_view_components-0.6.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.5.1 app/lib/primer/audited/dsl.rb
primer_view_components-0.5.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.4.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.3.1 app/lib/primer/audited/dsl.rb
primer_view_components-0.3.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.2.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.1.9 app/lib/primer/audited/dsl.rb
primer_view_components-0.1.8 app/lib/primer/audited/dsl.rb
primer_view_components-0.1.7 app/lib/primer/audited/dsl.rb
primer_view_components-0.1.6 app/lib/primer/audited/dsl.rb
primer_view_components-0.1.5 app/lib/primer/audited/dsl.rb
primer_view_components-0.1.4 app/lib/primer/audited/dsl.rb
primer_view_components-0.1.3 app/lib/primer/audited/dsl.rb
primer_view_components-0.1.2 app/lib/primer/audited/dsl.rb
primer_view_components-0.1.1 app/lib/primer/audited/dsl.rb
primer_view_components-0.1.0 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.123 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.122 app/lib/primer/audited/dsl.rb