Class: Warren::MessageFilter::Yaml

Inherits:
Warren::MessageFilter show all
Defined in:
lib/warren/filters/yaml.rb

Overview

Packs the message into a YAML string for transferring safely across the wire

Class Method Summary collapse

Methods inherited from Warren::MessageFilter

<<, filters, inherited, reset_filters

Class Method Details

.pack(msg) ⇒ Object

Returns a YAML string



10
11
12
# File 'lib/warren/filters/yaml.rb', line 10

def self.pack msg
  YAML.dump(msg)
end

.unpack(msg) ⇒ Object

Returns original message



15
16
17
# File 'lib/warren/filters/yaml.rb', line 15

def self.unpack msg
  YAML.load(msg)
end