Module: DataMapper::Serializer::ValidationErrors::ToYaml
- Included in:
- Validations::ValidationErrors
- Defined in:
- lib/dm-serializer/to_yaml.rb
Instance Method Summary collapse
-
#encode_with(coder) ⇒ undefined
A callback to encode the errors in the YAML stream.
-
#to_yaml(*args) ⇒ String
Serialize the errors to YAML.
Instance Method Details
#encode_with(coder) ⇒ undefined
A callback to encode the errors in the YAML stream
108 109 110 |
# File 'lib/dm-serializer/to_yaml.rb', line 108 def encode_with(coder) coder.map = Hash[errors] end |
#to_yaml(*args) ⇒ String
Serialize the errors to YAML
96 97 98 |
# File 'lib/dm-serializer/to_yaml.rb', line 96 def to_yaml(*args) Hash[errors].to_yaml(*args) end |