Class: PostCollectionsBody
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- PostCollectionsBody
- Defined in:
- lib/schemas.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_dynamic!(d) ⇒ Object
20537 20538 20539 20540 20541 20542 |
# File 'lib/schemas.rb', line 20537 def self.from_dynamic!(d) d = Types::Hash[d] new( collection: d["collection"] ? PostCollectionsBodyCollection.from_dynamic!(d["collection"]) : nil, ) end |
.from_json!(json) ⇒ Object
20544 20545 20546 |
# File 'lib/schemas.rb', line 20544 def self.from_json!(json) from_dynamic!(JSON.parse(json)) end |
Instance Method Details
#to_dynamic ⇒ Object
20548 20549 20550 20551 20552 |
# File 'lib/schemas.rb', line 20548 def to_dynamic { "collection" => collection&.to_dynamic, } end |
#to_json(options = nil) ⇒ Object
20554 20555 20556 |
# File 'lib/schemas.rb', line 20554 def to_json( = nil) JSON.generate(to_dynamic, ) end |