Module: Yobi::TagMessageWrapper

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

Overview

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

Class Method Summary collapse

Class Method Details

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

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

Parameters:

  • raw (Hash)

Returns:



42
43
44
45
46
47
48
# File 'lib/yobi/repository/tag.rb', line 42

def self.call(raw)
  case raw["message_type"]
  when "changed" then TagChange.new(raw)
  when "summary" then TagSummary.new(raw)
  else raw
  end
end