Module: Cerealize::Codec::Yaml

Defined in:
lib/cerealize/codec/yaml.rb

Class Method Summary (collapse)

Class Method Details

+ (Object) decode(str)



16
17
18
# File 'lib/cerealize/codec/yaml.rb', line 16

def decode(str)
  YAML.load(str)
end

+ (Object) encode(obj)



12
13
14
# File 'lib/cerealize/codec/yaml.rb', line 12

def encode(obj)
  YAML.dump(obj)
end

+ (Boolean) yours?(str)

See YAML spec (though might fail if "directives"?)



8
9
10
# File 'lib/cerealize/codec/yaml.rb', line 8

def yours?(str)
  str[0..2] == '---'
end