Class: Ortfodb::MediaConfiguration
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Ortfodb::MediaConfiguration
- Defined in:
- lib/ortfodb/configuration.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_dynamic!(d) ⇒ Object
123 124 125 126 127 128 |
# File 'lib/ortfodb/configuration.rb', line 123 def self.from_dynamic!(d) d = Types::Hash[d] new( at: d.fetch("at"), ) end |
.from_json!(json) ⇒ Object
130 131 132 |
# File 'lib/ortfodb/configuration.rb', line 130 def self.from_json!(json) from_dynamic!(JSON.parse(json)) end |
Instance Method Details
#to_dynamic ⇒ Object
134 135 136 137 138 |
# File 'lib/ortfodb/configuration.rb', line 134 def to_dynamic { "at" => at, } end |
#to_json(options = nil) ⇒ Object
140 141 142 |
# File 'lib/ortfodb/configuration.rb', line 140 def to_json( = nil) JSON.generate(to_dynamic, ) end |