Class: Ortfodb::MakeGIFSConfiguration
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Ortfodb::MakeGIFSConfiguration
- Defined in:
- lib/ortfodb/configuration.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_dynamic!(d) ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/ortfodb/configuration.rb', line 60 def self.from_dynamic!(d) d = Types::Hash[d] new( enabled: d.fetch("enabled"), file_name_template: d.fetch("file name template"), ) end |
.from_json!(json) ⇒ Object
68 69 70 |
# File 'lib/ortfodb/configuration.rb', line 68 def self.from_json!(json) from_dynamic!(JSON.parse(json)) end |
Instance Method Details
#to_dynamic ⇒ Object
72 73 74 75 76 77 |
# File 'lib/ortfodb/configuration.rb', line 72 def to_dynamic { "enabled" => enabled, "file name template" => file_name_template, } end |
#to_json(options = nil) ⇒ Object
79 80 81 |
# File 'lib/ortfodb/configuration.rb', line 79 def to_json( = nil) JSON.generate(to_dynamic, ) end |