Class: Codegen::Generators::Base
- Inherits:
-
Object
- Object
- Codegen::Generators::Base
- Includes:
- Hooks
- Defined in:
- lib/codegen/generators/base.rb
Overview
Sin, this is not DRYed enough, go look Codegen::Sources::Base :(
Direct Known Subclasses
Class Attribute Summary collapse
-
.convert_to ⇒ Object
Returns the value of attribute convert_to.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.convert_to ⇒ Object
Returns the value of attribute convert_to.
12 13 14 |
# File 'lib/codegen/generators/base.rb', line 12 def convert_to @convert_to end |
Class Method Details
.converts_to(*type) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/codegen/generators/base.rb', line 15 def self.converts_to * type if type.all? { |x| x.is_a? Symbol } self.convert_to = type else self.convert_to = type.map { |t| t.to_s.underscore.to_sym } end end |
Instance Method Details
#generate!(params) ⇒ Object
30 31 32 33 |
# File 'lib/codegen/generators/base.rb', line 30 def generate! params self.run_hook :before_generate, params generate params end |