Class: Scim::Kit::V2::Schema
- Inherits:
-
Object
- Object
- Scim::Kit::V2::Schema
- Includes:
- Templatable
- Defined in:
- lib/scim/kit/v2/schema.rb
Overview
Represents a SCIM Schema
Constant Summary collapse
- CORE =
'urn:ietf:params:scim:schemas:core:2.0'- ERROR =
'urn:ietf:params:scim:api:messages:2.0:Error'- GROUP =
"#{CORE}:Group"- RESOURCE_TYPE =
"#{CORE}:ResourceType"- SERVICE_PROVIDER_CONFIGURATION =
"#{CORE}:ServiceProviderConfig"- USER =
"#{CORE}:User"
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #add_attribute(name:, type: :string) {|attribute| ... } ⇒ Object
-
#initialize(id:, name:, location:) ⇒ Schema
constructor
A new instance of Schema.
Methods included from Templatable
#as_json, #render, #to_h, #to_json
Constructor Details
#initialize(id:, name:, location:) ⇒ Schema
Returns a new instance of Schema.
20 21 22 23 24 25 |
# File 'lib/scim/kit/v2/schema.rb', line 20 def initialize(id:, name:, location:) @id = id @name = name @location = location @attributes = [] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
17 18 19 |
# File 'lib/scim/kit/v2/schema.rb', line 17 def attributes @attributes end |
#description ⇒ Object
Returns the value of attribute description.
18 19 20 |
# File 'lib/scim/kit/v2/schema.rb', line 18 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
17 18 19 |
# File 'lib/scim/kit/v2/schema.rb', line 17 def id @id end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
17 18 19 |
# File 'lib/scim/kit/v2/schema.rb', line 17 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/scim/kit/v2/schema.rb', line 17 def name @name end |
Class Method Details
.build(*args) {|item| ... } ⇒ Object
33 34 35 36 37 |
# File 'lib/scim/kit/v2/schema.rb', line 33 def self.build(*args) item = new(*args) yield item item end |
Instance Method Details
#add_attribute(name:, type: :string) {|attribute| ... } ⇒ Object
27 28 29 30 31 |
# File 'lib/scim/kit/v2/schema.rb', line 27 def add_attribute(name:, type: :string) attribute = AttributeType.new(name: name, type: type) yield attribute if block_given? @attributes << attribute end |