Class: DdbRuby::FifthEdition::DisplayConfiguration
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- DdbRuby::FifthEdition::DisplayConfiguration
- Defined in:
- lib/ddb_ruby/fifth_edition/structs.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_dynamic!(d) ⇒ Object
1782 1783 1784 1785 1786 1787 1788 1789 1790 |
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 1782 def self.from_dynamic!(d) d = Types::Hash[d] new( racialtrait: d.fetch("RACIALTRAIT"), language: d.fetch("LANGUAGE"), abilityscore: d.fetch("ABILITYSCORE"), classfeature: d.fetch("CLASSFEATURE"), ) end |
.from_json!(json) ⇒ Object
1792 1793 1794 |
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 1792 def self.from_json!(json) from_dynamic!(JSON.parse(json)) end |
Instance Method Details
#to_dynamic ⇒ Object
1796 1797 1798 1799 1800 1801 1802 1803 |
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 1796 def to_dynamic { "RACIALTRAIT" => racialtrait, "LANGUAGE" => language, "ABILITYSCORE" => abilityscore, "CLASSFEATURE" => classfeature, } end |
#to_json(options = nil) ⇒ Object
1805 1806 1807 |
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 1805 def to_json( = nil) JSON.generate(to_dynamic, ) end |