Class: Foobara::RemoteGenerator::Services::AggregateModelGenerator
- Inherits:
-
ModelGenerator
- Object
- FilesGenerator
- TypescriptFromManifestBaseGenerator
- TypeGenerator
- ModelGenerator
- Foobara::RemoteGenerator::Services::AggregateModelGenerator
- Defined in:
- foobara-typescript-remote-command-generator-0.0.18/src/remote_generator/services/aggregate_model_generator.rb
Constant Summary
Constants included from TruncatedInspect
Instance Attribute Summary
Attributes inherited from FilesGenerator
#belongs_to_dependency_group, #relevant_manifest
Class Method Summary collapse
Instance Method Summary collapse
- #attributes_type_ts_type ⇒ Object
- #model_generators ⇒ Object
- #target_path ⇒ Object
- #template_path ⇒ Object
- #ts_instance_full_path ⇒ Object
Methods inherited from ModelGenerator
#model_name, #model_name_downcase, #model_prefix, #model_short_name
Methods inherited from TypeGenerator
#aggregate_attributes_ts_type, #atom_attributes_ts_type, #attribute_names, #custom_type_generators, #dependencies, #scoped_full_path, #type_guts, #type_name, #type_name_downcase, #type_prefix, #type_short_name
Methods inherited from TypescriptFromManifestBaseGenerator
#==, #attributes_to_ts_type, #custom_type_to_ts_type_name, #dependency_group, #dependency_roots, #foobara_type_to_ts_type, #hash, #import_destructure, #import_path, #import_path_array, #initialize, manifest_to_generator_classes, #model_to_ts_model_name, #parent, #templates_dir, #ts_instance_full_name, #ts_instance_path, #ts_type_full_path, #value_to_ts_value
Methods inherited from FilesGenerator
#==, #absolute_template_path, #applicable?, #dependencies, #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
Methods included from TruncatedInspect
Constructor Details
This class inherits a constructor from Foobara::RemoteGenerator::Services::TypescriptFromManifestBaseGenerator
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
6 7 8 9 10 11 12 13 14 15 16 |
# File 'foobara-typescript-remote-command-generator-0.0.18/src/remote_generator/services/aggregate_model_generator.rb', line 6 def new(relevant_manifest) return super unless self == AggregateModelGenerator if relevant_manifest.detached_entity? AggregateEntityGenerator.new(relevant_manifest) elsif relevant_manifest.has_associations? super else ModelGenerator.new(relevant_manifest) end end |
Instance Method Details
#attributes_type_ts_type ⇒ Object
37 38 39 |
# File 'foobara-typescript-remote-command-generator-0.0.18/src/remote_generator/services/aggregate_model_generator.rb', line 37 def attributes_type_ts_type aggregate_attributes_ts_type end |
#model_generators ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'foobara-typescript-remote-command-generator-0.0.18/src/remote_generator/services/aggregate_model_generator.rb', line 27 def model_generators types_depended_on.select(&:model?).map do |model| if model.detached_entity? Services::AggregateEntityGenerator.new(model) else Services::AggregateModelGenerator.new(model) end end end |
#target_path ⇒ Object
19 20 21 |
# File 'foobara-typescript-remote-command-generator-0.0.18/src/remote_generator/services/aggregate_model_generator.rb', line 19 def target_path [*super[..-2], "Aggregate.ts"] end |
#template_path ⇒ Object
23 24 25 |
# File 'foobara-typescript-remote-command-generator-0.0.18/src/remote_generator/services/aggregate_model_generator.rb', line 23 def template_path ["Model", "Aggregate.ts.erb"] end |
#ts_instance_full_path ⇒ Object
41 42 43 44 |
# File 'foobara-typescript-remote-command-generator-0.0.18/src/remote_generator/services/aggregate_model_generator.rb', line 41 def ts_instance_full_path *prefix, name = scoped_full_path [*prefix, "#{name}Aggregate"] end |