Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Provides the legacy `YAML.mapping` macro method

License

Notifications You must be signed in to change notification settings

crystal-lang/yaml_mapping.cr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important

This library is no longer supported or updated by the Crystal Team, therefore we have archived the repository.

The contents are still available readonly and continue to work as a shards dependency.

If you wish to continue development yourself, we recommend you fork it. We can also arrange to transfer ownership.

If you have further questions, please reach out on on https://forum.crystal-lang.org or [email protected]

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

  1. Add the dependency to your shard.yml:

    dependencies:
      yaml_mapping:
        github: crystal-lang/yaml_mapping.cr
  2. 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"

About

Provides the legacy `YAML.mapping` macro method

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •