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
primer_view_components-0.0.121 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.120 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.119 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.118 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.117 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.116 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.115 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.114 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.113 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.112 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.111 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.110 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.109 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.108 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.107 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.106 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.105 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.104 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.103 app/lib/primer/audited/dsl.rb
primer_view_components-0.0.102 app/lib/primer/audited/dsl.rb