struct
Amper::ObjectTree
- Amper::ObjectTree
- Struct
- Value
- Object
Overview
An ObjectTree contains the parsed information of a JSON file, and provides the methods
needed to generate the class, test, and spec files.
Defined in:
amper/object_tree.crConstructors
-
.new(name : String, json : JSON::Any)
Initializes an
ObjectTreefrom aJSON::Anyobject.
Instance Method Summary
- #name : String
- #raw(*args, **options)
- #raw(*args, **options, &)
-
#to_class : CGT::Class
Generates a Crystal class that can be deserialized from JSON files with the same structure as that used to generate
self. -
#to_class_file : String
Generates a Crystal file with a class that can be deserialized from JSON files with the same structure as that used to generate
self. -
#to_test_file(json_file_path : String) : String
Generates a file with unit tests for the generated class from
#to_class, based on theminitest.crframework.
Constructor Detail
Instance Method Detail
Generates a Crystal class that can be deserialized from JSON files with the same structure
as that used to generate self.
Generates a Crystal file with a class that can be deserialized from JSON files with the same
structure as that used to generate self.