Class: ScimGroupResourceMeta

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



14498
14499
14500
14501
14502
14503
14504
14505
# File 'lib/schemas.rb', line 14498

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    created:       d["created"],
    last_modified: d["lastModified"],
    resource_type: d["resourceType"],
  )
end

.from_json!(json) ⇒ Object



14507
14508
14509
# File 'lib/schemas.rb', line 14507

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



14511
14512
14513
14514
14515
14516
14517
# File 'lib/schemas.rb', line 14511

def to_dynamic
  {
    "created"      => created,
    "lastModified" => last_modified,
    "resourceType" => resource_type,
  }
end

#to_json(options = nil) ⇒ Object



14519
14520
14521
# File 'lib/schemas.rb', line 14519

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end