Sha256: a1be413e5e3ee6b99a545b7b67567a520a432a878e49b931502be7e0e6a61b9e

Contents?: true

Size: 589 Bytes

Versions: 12

Compression:

Stored size: 589 Bytes

Contents

# frozen_string_literal: true

module Scim
  module Kit
    module V2
      # Represents an Unknown/Unrecognized Attribute
      class UnknownAttribute
        include ::ActiveModel::Validations
        validate :unknown
        attr_reader :name

        def initialize(name)
          @name = name
        end

        def _assign(*_args)
          valid?
        end

        def _value=(*_args)
          raise Scim::Kit::UnknownAttributeError, name
        end

        def unknown
          errors.add(name, I18n.t('errors.messages.invalid'))
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
scim-kit-0.7.1 lib/scim/kit/v2/unknown_attribute.rb
scim-kit-0.7.0 lib/scim/kit/v2/unknown_attribute.rb
scim-kit-0.6.0 lib/scim/kit/v2/unknown_attribute.rb
scim-kit-0.5.3 lib/scim/kit/v2/unknown_attribute.rb
scim-kit-0.5.2 lib/scim/kit/v2/unknown_attribute.rb
scim-kit-0.5.1 lib/scim/kit/v2/unknown_attribute.rb
scim-kit-0.5.0 lib/scim/kit/v2/unknown_attribute.rb
scim-kit-0.4.0 lib/scim/kit/v2/unknown_attribute.rb
scim-kit-0.3.2 lib/scim/kit/v2/unknown_attribute.rb
scim-kit-0.3.1 lib/scim/kit/v2/unknown_attribute.rb
scim-kit-0.3.0 lib/scim/kit/v2/unknown_attribute.rb
scim-kit-0.2.16 lib/scim/kit/v2/unknown_attribute.rb