Module: Steamd::Generator::Implementation
- Included in:
- Ruby
- Defined in:
- lib/steamd/generator/implementation.rb
Overview
The underlying Implementation of a generator.
Instance Method Summary collapse
-
#classes ⇒ Object
The classes parsed from the lanaguage.
-
#enums ⇒ Object
The enums parsed from the language.
-
#imports ⇒ Object
The imports parsed from the language.
-
#initialize(io) ⇒ Object
Instantiate the object with a given IO stream.
-
#run ⇒ Object
Run the generator.
Instance Method Details
#classes ⇒ Object
The classes parsed from the lanaguage
43 44 45 46 47 |
# File 'lib/steamd/generator/implementation.rb', line 43 def classes @parser.classes.map do |klass| GeneratedClass.new(klass) end end |
#enums ⇒ Object
The enums parsed from the language
57 58 59 60 61 |
# File 'lib/steamd/generator/implementation.rb', line 57 def enums @parser.enums.map do |enum| GeneratedEnum.new(enum) end end |
#imports ⇒ Object
The imports parsed from the language
50 51 52 53 54 |
# File 'lib/steamd/generator/implementation.rb', line 50 def imports @parser.imports.map do |import| GeneratedImport.new(import) end end |
#initialize(io) ⇒ Object
Instantiate the object with a given IO stream.
25 26 27 28 29 30 |
# File 'lib/steamd/generator/implementation.rb', line 25 def initialize(io) @parser = Steamd::Parser.new @buffer = '' @io = io self end |
#run ⇒ Object
Run the generator. Load the parser, and parse the IO object.
35 36 37 38 39 40 |
# File 'lib/steamd/generator/implementation.rb', line 35 def run @parser.load! @parser.parse(@io) generate @buffer end |