Class: ProfileOrganizationResponse

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



3336
3337
3338
3339
3340
3341
# File 'lib/schemas.rb', line 3336

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    id: d.fetch("id"),
  )
end

.from_json!(json) ⇒ Object



3343
3344
3345
# File 'lib/schemas.rb', line 3343

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

Instance Method Details

#to_dynamicObject



3347
3348
3349
3350
3351
# File 'lib/schemas.rb', line 3347

def to_dynamic
  {
    "id" => id,
  }
end

#to_json(options = nil) ⇒ Object



3353
3354
3355
# File 'lib/schemas.rb', line 3353

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