Class: GetTagsSlugEntitiesResponseData

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



16306
16307
16308
16309
16310
16311
# File 'lib/schemas.rb', line 16306

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    entities: d.fetch("entities").map { |x| GetTagsSlugEntitiesResponseDataEntitiesItem.from_dynamic!(x) },
  )
end

.from_json!(json) ⇒ Object



16313
16314
16315
# File 'lib/schemas.rb', line 16313

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

Instance Method Details

#to_dynamicObject



16317
16318
16319
16320
16321
# File 'lib/schemas.rb', line 16317

def to_dynamic
  {
    "entities" => entities.map { |x| x.to_dynamic },
  }
end

#to_json(options = nil) ⇒ Object



16323
16324
16325
# File 'lib/schemas.rb', line 16323

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