class
   Crygen::Types::Enum
  
  - Crygen::Types::Enum
 - Crygen::Interfaces::GeneratorInterface
 - Reference
 - Object
 
Overview
A class that generates an enumeration (enum).
enum_type = Crygen::Types::Enum.new("Person")
enum_type.add_constant("Employee")
enum_type.add_constant("Student")
enum_type.add_constant("Intern")
puts enum_type.generate
Output:
enum Person
  Employee
  Student
  Intern
end
  Included Modules
Defined in:
types/enum.crConstructors
Instance Method Summary
- 
        #add_constant(name : String, value : String | Nil = nil) : self
        
          
Adds a constant into enum (name and value).
 - 
        #generate : String
        
          
Generates an enum.
 
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
Instance methods inherited from module Crygen::Modules::Method
  
  
    
      add_method(method : Crygen::Types::Method) : self
    add_method
    
  
      
      
      
    
      
  Instance methods inherited from module Crygen::Modules::Comment
  
  
    
      add_comment(value : String) : self
    add_comment
    
  
      
      
      
    
      
  Instance methods inherited from class Crygen::Interfaces::GeneratorInterface
  
  
    
      generate : String
    generate
    
  
      
      
      
    
      
      
      
      
    
      
      
      
      
    
  Constructor Detail
Instance Method Detail
Adds a constant into enum (name and value).
enum_type = Crygen::Types::Enum.new("Person")
enum_type.add_constant("Employee")
enum_type = Crygen::Types::Enum.new("Person")
enum_type.add_constant("Employee", 1)
Output: enum Person Employee end