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
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.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #add_attribute(name:, type: :string) {|attribute| ... } ⇒ Object
- #core? ⇒ Boolean
-
#initialize(id:, name:, location:) {|_self| ... } ⇒ Schema
constructor
A new instance of Schema.
Methods included from Templatable
#as_json, #render, #template_name, #to_h, #to_json
Constructor Details
#initialize(id:, name:, location:) {|_self| ... } ⇒ Schema
Returns a new instance of Schema.
13 14 15 16 17 18 19 20 21 |
# File 'lib/scim/kit/v2/schema.rb', line 13 def initialize(id:, name:, location:) @id = id @name = name @description = name @meta = Meta.new('Schema', location) @meta.created = @meta.last_modified = @meta.version = nil @attributes = [] yield self if block_given? end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
10 11 12 |
# File 'lib/scim/kit/v2/schema.rb', line 10 def attributes @attributes end |
#description ⇒ Object
Returns the value of attribute description.
11 12 13 |
# File 'lib/scim/kit/v2/schema.rb', line 11 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/scim/kit/v2/schema.rb', line 10 def id @id end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
10 11 12 |
# File 'lib/scim/kit/v2/schema.rb', line 10 def @meta end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/scim/kit/v2/schema.rb', line 10 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
23 24 25 26 27 |
# File 'lib/scim/kit/v2/schema.rb', line 23 def add_attribute(name:, type: :string) attribute = AttributeType.new(name: name, type: type) yield attribute if block_given? attributes << attribute end |