class
Crygen::Types::Struct
- Crygen::Types::Struct
- Crygen::Interfaces::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::Mixin
- Crygen::Modules::Property
Defined in:
types/struct.crConstructors
Instance Method Summary
-
#generate : String
Generates a struct.
Instance methods inherited from module Crygen::Modules::Mixin
add_extend(name : String) : self
add_extend,
add_include(name : String) : self
add_include
Instance methods inherited from module Crygen::Modules::Annotation
add_annotation(annotation_type : Crygen::Types::Annotation) : self
add_annotation
Instance methods inherited from module Crygen::Helpers::Annotation
add_link(name : String) : self
add_link,
as_deprecated(message : String) : selfas_deprecated : self as_deprecated, as_experimental(message : String) : self
as_experimental : self as_experimental, as_flags : self as_flags