Class: SyncRequest

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



1202
1203
1204
1205
1206
1207
# File 'lib/schemas.rb', line 1202

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

.from_json!(json) ⇒ Object



1209
1210
1211
# File 'lib/schemas.rb', line 1209

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

Instance Method Details

#to_dynamicObject



1213
1214
1215
1216
1217
# File 'lib/schemas.rb', line 1213

def to_dynamic
  {
    "excludeSubdomains" => exclude_subdomains,
  }
end

#to_json(options = nil) ⇒ Object



1219
1220
1221
# File 'lib/schemas.rb', line 1219

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