Class: JSONStringified
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- JSONStringified
- Defined in:
- lib/schemas.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_dynamic!(d) ⇒ Object
36496 36497 36498 36499 36500 36501 36502 36503 |
# File 'lib/schemas.rb', line 36496 def self.from_dynamic!(d) d = Types::Hash[d] new( input: d["input"], json_stringified_options: d["options"], json_stringified_type: d["type"], ) end |
.from_json!(json) ⇒ Object
36505 36506 36507 |
# File 'lib/schemas.rb', line 36505 def self.from_json!(json) from_dynamic!(JSON.parse(json)) end |
Instance Method Details
#to_dynamic ⇒ Object
36509 36510 36511 36512 36513 36514 36515 |
# File 'lib/schemas.rb', line 36509 def to_dynamic { "input" => input, "options" => , "type" => json_stringified_type, } end |
#to_json(options = nil) ⇒ Object
36517 36518 36519 |
# File 'lib/schemas.rb', line 36517 def to_json( = nil) JSON.generate(to_dynamic, ) end |