module DataMapper::Serializer::ValidationErrors::ToYaml
Public Instance Methods
encode_with(coder)
click to toggle source
A callback to encode the errors in the YAML stream
@param [#add] coder
handles adding the values to the output
@return [undefined]
@api public
# File lib/dm-serializer/to_yaml.rb, line 108 def encode_with(coder) coder.map = Hash[errors] end
to_yaml(*args)
click to toggle source
Serialize
the errors to YAML
@example
yaml = errors.to_yaml # => a valid YAML string
@param [Hash] options
@return [String]
@api public
# File lib/dm-serializer/to_yaml.rb, line 96 def to_yaml(*args) Hash[errors].to_yaml(*args) end