Class: ScimUserResourceName

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



15396
15397
15398
15399
15400
15401
15402
# File 'lib/schemas.rb', line 15396

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    family_name: d["familyName"],
    given_name:  d["givenName"],
  )
end

.from_json!(json) ⇒ Object



15404
15405
15406
# File 'lib/schemas.rb', line 15404

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

Instance Method Details

#to_dynamicObject



15408
15409
15410
15411
15412
15413
# File 'lib/schemas.rb', line 15408

def to_dynamic
  {
    "familyName" => family_name,
    "givenName"  => given_name,
  }
end

#to_json(options = nil) ⇒ Object



15415
15416
15417
# File 'lib/schemas.rb', line 15415

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