Class: Scim::Kit::V2::Error

Inherits:
Resource show all
Defined in:
lib/scim/kit/v2/error.rb

Overview

Represents a SCIM Error

Constant Summary collapse

SCIM_TYPES =
%w[
  invalidFilter
  invalidPath
  invalidSyntax
  invalidValue
  invalidVers
  mutability
  noTarget
  sensitive
  tooMany
  uniqueness
].freeze

Instance Attribute Summary

Attributes inherited from Resource

#meta, #raw_attributes, #schemas

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#mode?

Methods included from Templatable

#as_json, #render, #to_h, #to_json

Methods included from Attributable

#assign_attributes, #attribute_for, #define_attributes_for, #dynamic_attributes, #each, #read_attribute, #write_attribute

Constructor Details

#initialize(schemas: [self.class.default_schema]) ⇒ Error

Returns a new instance of Error.



21
22
23
# File 'lib/scim/kit/v2/error.rb', line 21

def initialize(schemas: [self.class.default_schema])
  super(schemas: schemas)
end

Class Method Details

.default_schemaObject



29
30
31
32
33
34
35
36
37
# File 'lib/scim/kit/v2/error.rb', line 29

def self.default_schema
  Schema.new(id: Messages::ERROR, name: 'Error', location: nil) do |x|
    x.add_attribute(name: :scim_type) do |attribute|
      attribute.canonical_values = SCIM_TYPES
    end
    x.add_attribute(name: :detail)
    x.add_attribute(name: :status, type: :string)
  end
end

Instance Method Details

#template_nameObject



25
26
27
# File 'lib/scim/kit/v2/error.rb', line 25

def template_name
  'resource.json.jbuilder'
end