Class: Foobara::RemoteGenerator::Generators::AggregateEntityGenerator
- Inherits:
-
LoadedEntityGenerator
show all
- Defined in:
- foobara-typescript-remote-command-generator-1.3.1/src/generators/aggregate_entity_generator.rb
Constant Summary
TruncatedInspect::MAX_LENGTH
Instance Attribute Summary
#belongs_to_dependency_group, #relevant_manifest
Class Method Summary
collapse
Instance Method Summary
collapse
#association_property_paths_ts, #attribute_names, #entity_name, #entity_name_downcase, #entity_short_name, #primary_key_name, #primary_key_ts_type, #will_define
#import_destructure, #model_name, #model_name_downcase, #model_prefix, #model_short_name
#aggregate_attributes_ts_type, #atom_attributes_ts_type, #attribute_names, #custom_type_generators, lru_cache, #scoped_full_path, #type_guts, #type_name, #type_name_downcase, #type_prefix, #type_short_name
#==, #attributes_to_ts_type, #auto_dirty_queries?, #collision_winners, #custom_type_to_ts_type_name, #dependency_group, #dependency_roots, #domain_name, #foobara_type_to_ts_type, #hash, #import_destructure, #import_path, #import_path_array, #initialize, manifest_to_generator_classes, #model_to_ts_model_name, #organization_name, #parent, #path_to_root, #templates_dir, #ts_instance_full_name, #ts_instance_full_path, #value_to_ts_value, #will_define
#==, #absolute_template_path, #applicable?, #dependencies_to_generate, #eql?, #erb_template, #generate, generator_for, #generator_for, generators_for, #generators_for, #hash, #initialize, manifest_to_generator_classes, #method_missing, #path_to_root, #respond_to_missing?, #target_dir, #template_string, #templates_dir
#inspect, truncating
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Foobara::FilesGenerator
Class Method Details
.new(relevant_manifest) ⇒ Object
8
9
10
11
12
13
14
15
16
|
# File 'src/generators/aggregate_entity_generator.rb', line 8
def new(relevant_manifest)
return super unless self == AggregateEntityGenerator
if relevant_manifest.has_associations?
super
else
LoadedEntityGenerator.new(relevant_manifest)
end
end
|
Instance Method Details
#attributes_type_ts_type ⇒ Object
41
42
43
|
# File 'src/generators/aggregate_entity_generator.rb', line 41
def attributes_type_ts_type
aggregate_attributes_ts_type
end
|
#dependencies ⇒ Object
33
34
35
|
# File 'src/generators/aggregate_entity_generator.rb', line 33
def dependencies
[*super, superclass_generator]
end
|
#generated_type ⇒ Object
49
50
51
|
# File 'src/generators/aggregate_entity_generator.rb', line 49
def generated_type
"#{scoped_short_name}Aggregate"
end
|
#model_generators ⇒ Object
27
28
29
30
31
|
# File 'src/generators/aggregate_entity_generator.rb', line 27
def model_generators
@model_generators ||= types_depended_on.select(&:model?).map do |model|
AggregateModelGenerator.new(model)
end
end
|
#superclass_generator ⇒ Object
37
38
39
|
# File 'src/generators/aggregate_entity_generator.rb', line 37
def superclass_generator
@superclass_generator ||= LoadedEntityGenerator.new(relevant_manifest)
end
|
#target_path ⇒ Object
19
20
21
|
# File 'src/generators/aggregate_entity_generator.rb', line 19
def target_path
[*super[..-2], "Aggregate.ts"]
end
|
#template_path ⇒ Object
23
24
25
|
# File 'src/generators/aggregate_entity_generator.rb', line 23
def template_path
["Entity", "Aggregate.ts.erb"]
end
|
#ts_instance_path ⇒ Object
45
46
47
|
# File 'src/generators/aggregate_entity_generator.rb', line 45
def ts_instance_path
[*model_prefix, generated_type]
end
|