Class: Foobara::Generators::TypeGenerator::GenerateType

Inherits:
Generate show all
Defined in:
foobara-type-generator-0.0.4/src/generate_type.rb

Defined Under Namespace

Classes: MissingManifestError

Constant Summary

Constants included from TruncatedInspect

TruncatedInspect::MAX_LENGTH

Instance Attribute Summary collapse

Attributes inherited from Generate

#element_to_generate

Attributes included from CommandPatternImplementation::Concerns::Subcommands

#is_subcommand

Attributes included from CommandPatternImplementation::Concerns::Runtime

#exception, #outcome

Attributes included from CommandPatternImplementation::Concerns::Errors

#error_collection

Attributes included from CommandPatternImplementation::Concerns::Inputs

#inputs, #raw_inputs

Instance Method Summary collapse

Methods inherited from Generate

#each_element_to_generate, #elements_to_generate, #generate_element, #generated, #generated_elements, #include_non_templated_files, #paths_to_source_code

Methods inherited from Command

install!, reset_all

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Methods included from CommandPatternImplementation::Concerns::Reflection

#initialize

Methods included from CommandPatternImplementation::Concerns::DomainMappers

#domain_map, #domain_map!, #run_mapped_subcommand!

Methods included from CommandPatternImplementation::Concerns::Subcommands

#run_subcommand!, #subcommand?

Methods included from CommandPatternImplementation::Concerns::Entities

#load_entities, #load_records

Methods included from CommandPatternImplementation::Concerns::Transactions

#auto_detect_current_transactions, #commit_transaction, #open_transaction, #opened_transactions, #relevant_entity_classes, #rollback_transaction, #transactions

Methods included from CommandPatternImplementation::Concerns::StateMachine

#state_machine

Methods included from CommandPatternImplementation::Concerns::Runtime

#halt!, #run, #run!, #run_execute, #succeed, #success?, #validate, #validate_records

Methods included from CommandPatternImplementation::Concerns::Errors

#initialize

Methods included from CommandPatternImplementation::Concerns::Inputs

#cast_and_validate_inputs, #initialize, #method_missing, #respond_to_missing?, #respond_to_missing_for_inputs?

Methods included from TruncatedInspect

#inspect, truncating

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Foobara::CommandPatternImplementation::Concerns::Inputs

Instance Attribute Details

#manifest_dataObject

Returns the value of attribute manifest_data.



25
26
27
# File 'foobara-type-generator-0.0.4/src/generate_type.rb', line 25

def manifest_data
  @manifest_data
end

Instance Method Details

#add_initial_elements_to_generateObject



39
40
41
# File 'foobara-type-generator-0.0.4/src/generate_type.rb', line 39

def add_initial_elements_to_generate
  elements_to_generate << type_config
end

#base_generatorObject



27
28
29
# File 'foobara-type-generator-0.0.4/src/generate_type.rb', line 27

def base_generator
  Generators::TypeGenerator
end

#executeObject



15
16
17
18
19
20
21
22
23
# File 'foobara-type-generator-0.0.4/src/generate_type.rb', line 15

def execute
  add_initial_elements_to_generate

  each_element_to_generate do
    generate_element
  end

  paths_to_source_code
end

#templates_dirObject

TODO: delegate this to base_generator



32
33
34
35
36
37
# File 'foobara-type-generator-0.0.4/src/generate_type.rb', line 32

def templates_dir
  # TODO: implement this?
  # :nocov:
  "#{__dir__}/../templates"
  # :nocov:
end

#type_configObject



43
44
45
# File 'foobara-type-generator-0.0.4/src/generate_type.rb', line 43

def type_config
  @type_config ||= TypeConfig.new(inputs)
end