Class: Enterprisifier::CodeGeneration::GroupGenerator

Inherits:
CodeGenerator
  • Object
show all
Defined in:
lib/enterprisifier/code_generation/generators/group_generator.rb

Constant Summary

Constants inherited from CodeGenerator

CodeGenerator::FacetElements

Instance Attribute Summary

Attributes inherited from CodeGenerator

#dependencies, #entity_name

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_macrosObject



10
11
12
13
14
# File 'lib/enterprisifier/code_generation/generators/group_generator.rb', line 10

def attribute_macros
  @attribute_macros ||= super.tap do |m|
    m << [:ref, @generator.modularize_type(@node.ref, @mod_name, "Groups")] if @node.ref
  end
end

#requiresObject



16
17
18
19
20
21
22
23
# File 'lib/enterprisifier/code_generation/generators/group_generator.rb', line 16

def requires
  @requires ||= super.tap do |r|
    next unless @node.ref
    mt = @generator.modularize_type(@node.ref, @mod_name, "Groups")
    p = mt.split("::").map(&:underscore).join("/")
    r << p
  end
end