Class: ScimUserResourceMeta

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



15362
15363
15364
15365
15366
15367
15368
15369
# File 'lib/schemas.rb', line 15362

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



15371
15372
15373
# File 'lib/schemas.rb', line 15371

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

Instance Method Details

#to_dynamicObject



15375
15376
15377
15378
15379
15380
15381
# File 'lib/schemas.rb', line 15375

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

#to_json(options = nil) ⇒ Object



15383
15384
15385
# File 'lib/schemas.rb', line 15383

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