Class: PostApisResponse
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- PostApisResponse
- Defined in:
- lib/schemas.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_dynamic!(d) ⇒ Object
20207 20208 20209 20210 20211 20212 20213 20214 20215 20216 20217 20218 20219 |
# File 'lib/schemas.rb', line 20207 def self.from_dynamic!(d) d = Types::Hash[d] new( created_at: d["createdAt"], created_by: d["createdBy"], description: d["description"], id: d["id"], post_apis_response_name: d["name"], summary: d["summary"], updated_at: d["updatedAt"], updated_by: d["updatedBy"], ) end |
.from_json!(json) ⇒ Object
20221 20222 20223 |
# File 'lib/schemas.rb', line 20221 def self.from_json!(json) from_dynamic!(JSON.parse(json)) end |
Instance Method Details
#to_dynamic ⇒ Object
20225 20226 20227 20228 20229 20230 20231 20232 20233 20234 20235 20236 |
# File 'lib/schemas.rb', line 20225 def to_dynamic { "createdAt" => created_at, "createdBy" => created_by, "description" => description, "id" => id, "name" => post_apis_response_name, "summary" => summary, "updatedAt" => updated_at, "updatedBy" => updated_by, } end |
#to_json(options = nil) ⇒ Object
20238 20239 20240 |
# File 'lib/schemas.rb', line 20238 def to_json( = nil) JSON.generate(to_dynamic, ) end |