Class: GithubCommitStatus2

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schema.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



1337
1338
1339
1340
1341
1342
# File 'lib/schema.rb', line 1337

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

.from_json!(json) ⇒ Object



1344
1345
1346
# File 'lib/schema.rb', line 1344

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

Instance Method Details

#to_dynamicObject



1348
1349
1350
1351
1352
# File 'lib/schema.rb', line 1348

def to_dynamic
  {
    "context" => context
  }
end

#to_json(options = nil) ⇒ Object



1354
1355
1356
# File 'lib/schema.rb', line 1354

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