Provides the legacy
YAML.mapping macro method.
This shard is provided as-is and considered deprecated. It won't receive feature enhancements.
Please consider using
YAML::Serializable instead, the successor included in Crystal's standard library.
Add the dependency to your
dependencies: yaml_mapping: github: crystal-lang/yaml_mapping.cr
require "yaml_mapping" class Employee YAML.mapping( title: String, name: String, ) end employee = Employee.from_yaml("title: Manager\nname: John") employee.title # => "Manager" employee.name # => "John" employee.name = "Jenny" employee.name # => "Jenny"
- Fork it (https://github.com/crystal-lang/yaml_mapping.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request
- 6 months ago
- May 20, 2020
Thu, 21 Oct 2021 11:55:30 GMT