Class: Moku6::Generators::TypeScriptGenerator
- Inherits:
-
BaseGenerator
- Object
- BaseGenerator
- Moku6::Generators::TypeScriptGenerator
- Defined in:
- lib/moku6/generators/typescript_generator.rb
Constant Summary
Constants inherited from BaseGenerator
Instance Method Summary collapse
-
#render ⇒ Object
: () -> String.
Methods inherited from BaseGenerator
Constructor Details
This class inherits a constructor from Moku6::Generators::BaseGenerator
Instance Method Details
#render ⇒ Object
: () -> String
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/moku6/generators/typescript_generator.rb', line 8 def render events = @catalog.sorted out = ["// #{AUTOGEN_NOTE}", ""] out.concat(union_type(events)) out << "" events.each { |e| out.concat(interface(e)) } out << "export interface AuditEventMetadataMap {" events.each { |e| out << " \"#{e.action}\": #{iface_name(e)};" } out << "}" out << "" out.join("\n") end |