Class: PostMonitorsBodyMonitorSchedule

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



24993
24994
24995
24996
24997
24998
24999
# File 'lib/schemas.rb', line 24993

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

.from_json!(json) ⇒ Object



25001
25002
25003
# File 'lib/schemas.rb', line 25001

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

Instance Method Details

#to_dynamicObject



25005
25006
25007
25008
25009
25010
# File 'lib/schemas.rb', line 25005

def to_dynamic
  {
    "cron"     => cron,
    "timezone" => timezone,
  }
end

#to_json(options = nil) ⇒ Object



25012
25013
25014
# File 'lib/schemas.rb', line 25012

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