This project was created by a developer from Ukraine.
Russia has invaded Ukraine and already killed tens of thousands of civilians, with many more raped or tortured.
The death toll keeps climbing. It's a genocide. We need your help. Let's fight back against the Russian regime.
#StandWithUkraine
This project was created by a developer from Ukraine.
Russia has invaded Ukraine and already killed tens of thousands of civilians,
with many more raped or tortured. It's a genocide. We need your help.
#StandWithUkraine
yaml_mapping.cr v0.1.1
yaml_mapping
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.
Installation
-
Add the dependency to your
shard.yml
:dependencies: yaml_mapping: github: crystal-lang/yaml_mapping.cr
-
Run
shards install
Usage
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"
Contributing
- 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
- 7
- 6
- 2
- 0
- over 1 year ago
- May 20, 2020
MIT License
Tue, 09 Aug 2022 05:48:45 GMT