Module: Yobi::CheckMessageWrapper

Defined in:
lib/yobi/repository/check.rb,
sig/yobi.rbs

Overview

Classifies a raw check message Hash by its own message_type, wrapping it in the matching typed class. Used both as the ResticOutput transform: for Repository#check and by CheckOutcome's own post-hoc accessors.

Class Method Summary collapse

Class Method Details

.call(raw) ⇒ Yobi::CheckError, ...

Returns the raw Hash itself for a message_type this version of Yobi doesn't recognize.

Parameters:

  • raw (Hash)

Returns:



39
40
41
42
43
44
45
# File 'lib/yobi/repository/check.rb', line 39

def self.call(raw)
  case raw["message_type"]
  when "error" then CheckError.new(raw)
  when "summary" then CheckSummary.new(raw)
  else raw
  end
end