Class: PostCollectionsBodyCollectionItemItem

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



20473
20474
20475
20476
20477
20478
# File 'lib/schemas.rb', line 20473

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

.from_json!(json) ⇒ Object



20480
20481
20482
# File 'lib/schemas.rb', line 20480

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

Instance Method Details

#to_dynamicObject



20484
20485
20486
20487
20488
# File 'lib/schemas.rb', line 20484

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

#to_json(options = nil) ⇒ Object



20490
20491
20492
# File 'lib/schemas.rb', line 20490

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