Class: APIDetailsCollectionsItem

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



35620
35621
35622
35623
35624
35625
# File 'lib/schemas.rb', line 35620

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

.from_json!(json) ⇒ Object



35627
35628
35629
# File 'lib/schemas.rb', line 35627

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

Instance Method Details

#to_dynamicObject



35631
35632
35633
35634
35635
# File 'lib/schemas.rb', line 35631

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

#to_json(options = nil) ⇒ Object



35637
35638
35639
# File 'lib/schemas.rb', line 35637

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