Class: PostCollectionsForkCollectionIDResponseCollectionFork

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



21737
21738
21739
21740
21741
21742
21743
21744
# File 'lib/schemas.rb', line 21737

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    created_at: d["createdAt"],
    from:       d["from"],
    label:      d["label"],
  )
end

.from_json!(json) ⇒ Object



21746
21747
21748
# File 'lib/schemas.rb', line 21746

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

Instance Method Details

#to_dynamicObject



21750
21751
21752
21753
21754
21755
21756
# File 'lib/schemas.rb', line 21750

def to_dynamic
  {
    "createdAt" => created_at,
    "from"      => from,
    "label"     => label,
  }
end

#to_json(options = nil) ⇒ Object



21758
21759
21760
# File 'lib/schemas.rb', line 21758

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