Class: ProjectsDeleteResponse

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



2477
2478
2479
2480
2481
2482
# File 'lib/schemas.rb', line 2477

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

.from_json!(json) ⇒ Object



2484
2485
2486
# File 'lib/schemas.rb', line 2484

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

Instance Method Details

#to_dynamicObject



2488
2489
2490
2491
2492
# File 'lib/schemas.rb', line 2488

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

#to_json(options = nil) ⇒ Object



2494
2495
2496
# File 'lib/schemas.rb', line 2494

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