Class: Scim::Kit::V2::Resource

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations, Templatable, Attributable
Defined in:
lib/scim/kit/v2/resource.rb

Overview

Represents a SCIM Resource

Instance Attribute Summary collapse

Attributes included from Attributable

#dynamic_attributes

Instance Method Summary collapse

Methods included from Templatable

#as_json, #render, #to_h, #to_json

Methods included from Attributable

#define_attributes_for

Constructor Details

#initialize(schemas:, location:) ⇒ Resource

Returns a new instance of Resource.



19
20
21
22
23
24
25
# File 'lib/scim/kit/v2/resource.rb', line 19

def initialize(schemas:, location:)
  @meta = Meta.new(schemas[0].name, location)
  @schemas = schemas
  schemas.each do |schema|
    define_attributes_for(schema.attributes)
  end
end

Instance Attribute Details

#external_idObject

Returns the value of attribute external_id.



12
13
14
# File 'lib/scim/kit/v2/resource.rb', line 12

def external_id
  @external_id
end

#idObject

Returns the value of attribute id.



12
13
14
# File 'lib/scim/kit/v2/resource.rb', line 12

def id
  @id
end

#metaObject (readonly)

Returns the value of attribute meta.



13
14
15
# File 'lib/scim/kit/v2/resource.rb', line 13

def meta
  @meta
end

#schemasObject (readonly)

Returns the value of attribute schemas.



14
15
16
# File 'lib/scim/kit/v2/resource.rb', line 14

def schemas
  @schemas
end