Class: DdbRuby::FifthEdition::DefinitionKeyNameMap

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/ddb_ruby/fifth_edition/structs.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



1120
1121
1122
1123
1124
1125
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 1120

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    feat_1212493: d["feat:1212493"],
  )
end

.from_json!(json) ⇒ Object



1127
1128
1129
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 1127

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



1131
1132
1133
1134
1135
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 1131

def to_dynamic
  {
    "feat:1212493" => feat_1212493,
  }
end

#to_json(options = nil) ⇒ Object



1137
1138
1139
# File 'lib/ddb_ruby/fifth_edition/structs.rb', line 1137

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end