Class: Scim::Kit::V2::Resource
- Inherits:
-
Object
- Object
- Scim::Kit::V2::Resource
- Includes:
- ActiveModel::Validations, Templatable, Attributable
- Defined in:
- lib/scim/kit/v2/resource.rb
Overview
Represents a SCIM Resource
Instance Attribute Summary collapse
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#schemas ⇒ Object
readonly
Returns the value of attribute schemas.
Attributes included from Attributable
Instance Method Summary collapse
-
#initialize(schemas:, location: nil) {|_self| ... } ⇒ Resource
constructor
A new instance of Resource.
- #mode?(type) ⇒ Boolean
Methods included from Templatable
#as_json, #render, #to_h, #to_json
Methods included from Attributable
Constructor Details
#initialize(schemas:, location: nil) {|_self| ... } ⇒ Resource
Returns a new instance of Resource.
19 20 21 22 23 24 25 26 27 |
# File 'lib/scim/kit/v2/resource.rb', line 19 def initialize(schemas:, location: nil) @meta = Meta.new(schemas[0].name, location) @meta. @schemas = schemas schemas.each do |schema| define_attributes_for(self, schema.attributes) end yield self if block_given? end |
Instance Attribute Details
#external_id ⇒ Object
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 |
#id ⇒ Object
Returns the value of attribute id.
12 13 14 |
# File 'lib/scim/kit/v2/resource.rb', line 12 def id @id end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
13 14 15 |
# File 'lib/scim/kit/v2/resource.rb', line 13 def @meta end |
#schemas ⇒ Object (readonly)
Returns the value of attribute schemas.
14 15 16 |
# File 'lib/scim/kit/v2/resource.rb', line 14 def schemas @schemas end |
Instance Method Details
#mode?(type) ⇒ Boolean
29 30 31 32 33 34 35 36 |
# File 'lib/scim/kit/v2/resource.rb', line 29 def mode?(type) case type.to_sym when :server &.location else &.location.nil? end end |