Class: Enterprisifier::CodeGeneration::UnionGenerator
- Inherits:
-
CodeGenerator
- Object
- CodeGenerator
- Enterprisifier::CodeGeneration::UnionGenerator
- Defined in:
- lib/enterprisifier/code_generation/generators/union_generator.rb
Constant Summary
Constants inherited from CodeGenerator
Instance Attribute Summary
Attributes inherited from CodeGenerator
Instance Method Summary collapse
Methods inherited from CodeGenerator
build, #entity_or_attr_name, extends, #extension_require, #initialize, macro_mappings, #macro_reference_require, #name, register, #to_ruby, #to_s, #write_file
Constructor Details
This class inherits a constructor from Enterprisifier::CodeGeneration::CodeGenerator
Instance Method Details
#attribute_macros ⇒ Object
9 10 11 12 13 |
# File 'lib/enterprisifier/code_generation/generators/union_generator.rb', line 9 def attribute_macros @attribute_macros ||= super.tap do |m| m << [:member_types, modularized_member_types.join(", ")] unless modularized_member_types.empty? end end |
#requires ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/enterprisifier/code_generation/generators/union_generator.rb', line 15 def requires @requires ||= super.tap do |r| mmt = modularized_member_types.collect do |mt| mt.split("::").map(&:underscore).join("/") end r.concat(mmt) end end |