Class: Antelope::Generator::Error
- Defined in:
- lib/antelope/generator/error.rb
Overview
Generates an output file, mainly for debugging. Included always as a generator for a grammar.
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#generate ⇒ void
Actually performs the generation.
-
#initialize ⇒ Error
constructor
Defines singleton method for every mod that the grammar passed to the generator.
Methods inherited from Base
directive, directives, inherited, register_as, source_root, #template
Methods included from Base::Extra
Methods included from Base::Coerce
#coerce_directive_class, #coerce_directive_value, #coerce_nested_hash, #directives
Constructor Details
#initialize ⇒ Error
Defines singleton method for every mod that the grammar passed to the generator.
18 19 20 21 22 23 |
# File 'lib/antelope/generator/error.rb', line 18 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
.
29 30 31 |
# File 'lib/antelope/generator/error.rb', line 29 def generate template "error", "#{file}.err" end |