Class: Antelope::Generator::Output
- Inherits:
-
Antelope::Generator
- Object
- Antelope::Generator
- Antelope::Generator::Output
- Defined in:
- lib/antelope/generator/output.rb
Overview
Generates an output file, mainly for debugging. Included always as a generator for a grammar.
Instance Attribute Summary
Attributes inherited from Antelope::Generator
Instance Method Summary collapse
-
#generate ⇒ void
Actually performs the generation.
-
#initialize ⇒ Output
constructor
Defines singleton method for every mod that the grammar passed to the generator.
Methods inherited from Antelope::Generator
Constructor Details
#initialize ⇒ Output
Defines singleton method for every mod that the grammar passed to the generator.
14 15 16 17 18 19 |
# File 'lib/antelope/generator/output.rb', line 14 def initialize(*) super mods.each do |k, v| define_singleton_method (k) { v } end end |
Instance Method Details
#generate ⇒ void
This method returns an undefined value.
Actually performs the generation. Uses the template in
output.erb, and generates the file <file>.output.
25 26 27 |
# File 'lib/antelope/generator/output.rb', line 25 def generate template "output.erb", "#{file}.output" end |