Class: Tapioca::Compilers::SymbolTable::SymbolGenerator
- Inherits:
-
Object
- Object
- Tapioca::Compilers::SymbolTable::SymbolGenerator
- Extended by:
- T::Sig
- Defined in:
- lib/tapioca/compilers/symbol_table/symbol_generator.rb
Constant Summary collapse
- IGNORED_SYMBOLS =
%w{ YAML MiniTest Mutex }
Instance Attribute Summary collapse
-
#gem ⇒ Object
readonly
Returns the value of attribute gem.
-
#indent ⇒ Object
readonly
Returns the value of attribute indent.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(gem, indent = 0) ⇒ SymbolGenerator
constructor
A new instance of SymbolGenerator.
Constructor Details
#initialize(gem, indent = 0) ⇒ SymbolGenerator
Returns a new instance of SymbolGenerator.
21 22 23 24 25 26 |
# File 'lib/tapioca/compilers/symbol_table/symbol_generator.rb', line 21 def initialize(gem, indent = 0) @gem = gem @indent = indent @seen = Set.new @alias_namespace ||= Set.new end |
Instance Attribute Details
#gem ⇒ Object (readonly)
Returns the value of attribute gem.
18 19 20 |
# File 'lib/tapioca/compilers/symbol_table/symbol_generator.rb', line 18 def gem @gem end |
#indent ⇒ Object (readonly)
Returns the value of attribute indent.
18 19 20 |
# File 'lib/tapioca/compilers/symbol_table/symbol_generator.rb', line 18 def indent @indent end |
Instance Method Details
#generate ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/tapioca/compilers/symbol_table/symbol_generator.rb', line 29 def generate symbols .sort .map { |symbol| generate_from_symbol(symbol) } .compact .join("\n\n") .concat("\n") end |