Class: Scimitar::ResourceType
- Inherits:
-
Object
- Object
- Scimitar::ResourceType
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/scimitar/resource_type.rb
Overview
Provides info about a resource type. Instances of this class are used to provide info through the /ResourceTypes endpoint of a SCIM service provider.
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#id ⇒ Object
Returns the value of attribute id.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#name ⇒ Object
Returns the value of attribute name.
-
#schema ⇒ Object
Returns the value of attribute schema.
-
#schemaExtensions ⇒ Object
Returns the value of attribute schemaExtensions.
-
#schemas ⇒ Object
Returns the value of attribute schemas.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(attributes = {}) ⇒ ResourceType
constructor
A new instance of ResourceType.
Constructor Details
#initialize(attributes = {}) ⇒ ResourceType
Returns a new instance of ResourceType.
7 8 9 10 11 12 13 14 15 |
# File 'app/models/scimitar/resource_type.rb', line 7 def initialize(attributes = {}) default_attributes = { meta: Meta.new( 'resourceType': 'ResourceType' ), schemas: ['urn:ietf:params:scim:schemas:core:2.0:ResourceType'] } super(default_attributes.merge(attributes)) end |
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
5 6 7 |
# File 'app/models/scimitar/resource_type.rb', line 5 def endpoint @endpoint end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'app/models/scimitar/resource_type.rb', line 5 def id @id end |
#meta ⇒ Object
Returns the value of attribute meta.
5 6 7 |
# File 'app/models/scimitar/resource_type.rb', line 5 def @meta end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'app/models/scimitar/resource_type.rb', line 5 def name @name end |
#schema ⇒ Object
Returns the value of attribute schema.
5 6 7 |
# File 'app/models/scimitar/resource_type.rb', line 5 def schema @schema end |
#schemaExtensions ⇒ Object
Returns the value of attribute schemaExtensions.
5 6 7 |
# File 'app/models/scimitar/resource_type.rb', line 5 def schemaExtensions @schemaExtensions end |
#schemas ⇒ Object
Returns the value of attribute schemas.
5 6 7 |
# File 'app/models/scimitar/resource_type.rb', line 5 def schemas @schemas end |
Instance Method Details
#as_json(options = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/models/scimitar/resource_type.rb', line 18 def as_json( = {}) without_extensions = super(except: 'schemaExtensions') if schemaExtensions.present? extensions = schemaExtensions.map{|extension| {"schema" => extension, "required" => false}} without_extensions.merge('schemaExtensions' => extensions) else without_extensions end end |