Class: ResponseForProjectResponse
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- ResponseForProjectResponse
- Defined in:
- lib/schemas.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_dynamic!(d) ⇒ Object
2146 2147 2148 2149 2150 2151 2152 2153 |
# File 'lib/schemas.rb', line 2146 def self.from_dynamic!(d) d = Types::Hash[d] new( data: d["data"] ? ProjectResponse.from_dynamic!(d["data"]) : nil, error_message: d["errorMessage"], success: d.fetch("success"), ) end |
.from_json!(json) ⇒ Object
2155 2156 2157 |
# File 'lib/schemas.rb', line 2155 def self.from_json!(json) from_dynamic!(JSON.parse(json)) end |
Instance Method Details
#to_dynamic ⇒ Object
2159 2160 2161 2162 2163 2164 2165 |
# File 'lib/schemas.rb', line 2159 def to_dynamic { "data" => data&.to_dynamic, "errorMessage" => , "success" => success, } end |
#to_json(options = nil) ⇒ Object
2167 2168 2169 |
# File 'lib/schemas.rb', line 2167 def to_json( = nil) JSON.generate(to_dynamic, ) end |