Class: GetMonitorsMonitorIDResponseMonitorLastRunStatsAssertions

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



12472
12473
12474
12475
12476
12477
12478
# File 'lib/schemas.rb', line 12472

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

.from_json!(json) ⇒ Object



12480
12481
12482
# File 'lib/schemas.rb', line 12480

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

Instance Method Details

#to_dynamicObject



12484
12485
12486
12487
12488
12489
# File 'lib/schemas.rb', line 12484

def to_dynamic
  {
    "failed" => failed,
    "total"  => total,
  }
end

#to_json(options = nil) ⇒ Object



12491
12492
12493
# File 'lib/schemas.rb', line 12491

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