Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Test
- def initialize(@step : Hash(Symbol, String) | Nil, @tree : String)
- end
- def initialize
- @step = {} of Symbol => String
- @tree = ""
- end
- YAML.mapping({
- :step => {
- type: Hash(Symbol, String),
- nilable: true
- },
- :tree => String
- })
- def to_yaml(yaml : YAML::Generator)
- hash = {
- {% for key, value in @type.instance_variables %}
- {{key}}: %var{key},
- {% end %} # expecting token "=>" not "NEWLINE"
- } of String => YAML::Any
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment