Class: SoftFailElement

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



1139
1140
1141
1142
1143
1144
# File 'lib/schema.rb', line 1139

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    exit_status: d["exit_status"] ? SoftFailExitStatus.from_dynamic!(d["exit_status"]) : nil
  )
end

.from_json!(json) ⇒ Object



1146
1147
1148
# File 'lib/schema.rb', line 1146

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

Instance Method Details

#to_dynamicObject



1150
1151
1152
1153
1154
# File 'lib/schema.rb', line 1150

def to_dynamic
  {
    "exit_status" => exit_status&.to_dynamic
  }
end

#to_json(options = nil) ⇒ Object



1156
1157
1158
# File 'lib/schema.rb', line 1156

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