Class: GithubCommitStatus1

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



76
77
78
79
80
81
# File 'lib/schema.rb', line 76

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

.from_json!(json) ⇒ Object



83
84
85
# File 'lib/schema.rb', line 83

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

Instance Method Details

#to_dynamicObject



87
88
89
90
91
# File 'lib/schema.rb', line 87

def to_dynamic
  {
    "context" => context
  }
end

#to_json(options = nil) ⇒ Object



93
94
95
# File 'lib/schema.rb', line 93

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