Class: GithubCommitStatus3

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



1875
1876
1877
1878
1879
1880
# File 'lib/schema.rb', line 1875

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

.from_json!(json) ⇒ Object



1882
1883
1884
# File 'lib/schema.rb', line 1882

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

Instance Method Details

#to_dynamicObject



1886
1887
1888
1889
1890
# File 'lib/schema.rb', line 1886

def to_dynamic
  {
    "context" => context
  }
end

#to_json(options = nil) ⇒ Object



1892
1893
1894
# File 'lib/schema.rb', line 1892

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