class Crygen::Types::Struct
- Crygen::Types::Struct
- Crygen::Abstract::GeneratorInterface
- Reference
- Object
Overview
A class that generates a struct.
method_type = CGT::Method.new("full_name", "String")
method_type.add_body("John Doe".dump)
struct_type = test_point_struct()
struct_type.add_method(method_type)
puts struct_type.generate
Output:
# This is a struct called Point.
struct Point
def full_name : String
"John Doe"
end
end
Included Modules
- Crygen::Modules::Annotation
- Crygen::Modules::ClassVar
- Crygen::Modules::Comment
- Crygen::Modules::InstanceVar
- Crygen::Modules::Method
- Crygen::Modules::Property
Defined in:
types/struct.crConstructors
Instance Method Summary
-
#generate : String
Generates a struct.
Instance methods inherited from module Crygen::Modules::Annotation
add_annotation(annotation_type : Crygen::Types::Annotation) : self
add_annotation
Instance methods inherited from module Crygen::Modules::Method
add_method(method : Crygen::Types::Method) : self
add_method
Instance methods inherited from module Crygen::Modules::ClassVar
add_class_var(name : String, type : String, value : String) : selfadd_class_var(name : String, type : String) : self add_class_var, generate_class_vars : String generate_class_vars
Instance methods inherited from module Crygen::Modules::InstanceVar
add_instance_var(name : String, type : String, value : String) : selfadd_instance_var(name : String, type : String) : self add_instance_var, generate_instance_vars : String generate_instance_vars
Instance methods inherited from module Crygen::Modules::Property
add_property(visibility : Crygen::Enums::PropVisibility, name : String, type : String, scope : Crygen::Enums::PropScope = :public) : selfadd_property(visibility : Crygen::Enums::PropVisibility, name : String, type : String, value : String, scope : Crygen::Enums::PropScope = :public) : self add_property