Class: PostCollectionsMergeResponseCollection

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



22127
22128
22129
22130
22131
22132
22133
# File 'lib/schemas.rb', line 22127

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    id:  d["id"],
    uid: d["uid"],
  )
end

.from_json!(json) ⇒ Object



22135
22136
22137
# File 'lib/schemas.rb', line 22135

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

Instance Method Details

#to_dynamicObject



22139
22140
22141
22142
22143
22144
# File 'lib/schemas.rb', line 22139

def to_dynamic
  {
    "id"  => id,
    "uid" => uid,
  }
end

#to_json(options = nil) ⇒ Object



22146
22147
22148
# File 'lib/schemas.rb', line 22146

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