Class: DdbRuby::FifthEdition::CharacterFeat
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- DdbRuby::FifthEdition::CharacterFeat
- Defined in:
- lib/ddb_ruby/fifth_edition/structs.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_dynamic!(d) ⇒ Object
3272 3273 3274 3275 3276 3277 3278 3279 3280 |
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 3272 def self.from_dynamic!(d) d = Types::Hash[d] new( component_type_id: d.fetch("componentTypeId"), component_id: d.fetch("componentId"), definition: Definition1.from_dynamic!(d.fetch("definition")), definition_id: d.fetch("definitionId"), ) end |
.from_json!(json) ⇒ Object
3282 3283 3284 |
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 3282 def self.from_json!(json) from_dynamic!(JSON.parse(json)) end |
Instance Method Details
#to_dynamic ⇒ Object
3286 3287 3288 3289 3290 3291 3292 3293 |
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 3286 def to_dynamic { "componentTypeId" => component_type_id, "componentId" => component_id, "definition" => definition.to_dynamic, "definitionId" => definition_id, } end |
#to_json(options = nil) ⇒ Object
3295 3296 3297 |
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 3295 def to_json( = nil) JSON.generate(to_dynamic, ) end |