Class: Xdrgen::Compilation
- Inherits:
-
Object
- Object
- Xdrgen::Compilation
- Extended by:
- Memoist
- Defined in:
- lib/xdrgen/compilation.rb
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(source_paths, output_dir: ".", language: :ruby, namespace: nil) ⇒ Compilation
constructor
A new instance of Compilation.
Constructor Details
#initialize(source_paths, output_dir: ".", language: :ruby, namespace: nil) ⇒ Compilation
Returns a new instance of Compilation.
5 6 7 8 9 10 |
# File 'lib/xdrgen/compilation.rb', line 5 def initialize(source_paths, output_dir:".", language: :ruby, namespace: nil) @source_paths = source_paths @output_dir = output_dir @namespace = namespace @language = language end |
Instance Method Details
#compile ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/xdrgen/compilation.rb', line 21 def compile output = Output.new(@source_paths, @output_dir) generator = Generators.for_language(@language).new(ast, output, @namespace) generator.generate ensure output.close end |