Class: Foobara::BuiltinTypes::Array::SupportedProcessors::ElementTypeDeclaration
- Inherits:
-
TypeDeclarations::ElementProcessor
- Object
- Value::Processor
- Types::ElementProcessor
- TypeDeclarations::ElementProcessor
- Foobara::BuiltinTypes::Array::SupportedProcessors::ElementTypeDeclaration
- Defined in:
- foobara-0.0.110/projects/builtin_types/src/array/supported_processors/element_type_declaration.rb
Instance Attribute Summary
Attributes inherited from Value::Processor
#created_in_namespace, #declaration_data, #parent_declaration_data
Instance Method Summary collapse
Methods included from Concern
foobara_class_methods_module_for, foobara_concern?, included
Methods inherited from Value::Processor
#always_applicable?, #applicable?, #attribute_name, #build_error, default_declaration_data, #dup_processor, error_class, error_classes, #error_context, #error_message, #error_path, foobara_manifest, #foobara_manifest, #initialize, #inspect, instance, #method_missing, #name, new_with_agnostic_args, #priority, #process_outcome, #process_outcome!, #process_value!, processor_name, requires_declaration_data?, requires_parent_declaration_data?, #respond_to_missing?, #runner, symbol
Methods included from IsManifestable
#foobara_domain, #foobara_manifest, #foobara_organization, #scoped_clear_caches
Constructor Details
This class inherits a constructor from Foobara::Value::Processor
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Foobara::Value::Processor
Instance Method Details
#element_type ⇒ Object
6 7 8 |
# File 'foobara-0.0.110/projects/builtin_types/src/array/supported_processors/element_type_declaration.rb', line 6 def element_type @element_type ||= type_for_declaration(element_type_declaration) end |
#possible_errors ⇒ Object
30 31 32 33 34 35 36 |
# File 'foobara-0.0.110/projects/builtin_types/src/array/supported_processors/element_type_declaration.rb', line 30 def possible_errors super + element_type.possible_errors.map do |possible_error| possible_error = possible_error.dup possible_error.prepend_path!(:"#") possible_error end end |
#process_value(array) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'foobara-0.0.110/projects/builtin_types/src/array/supported_processors/element_type_declaration.rb', line 10 def process_value(array) errors = [] array.each.with_index do |element, index| element_outcome = element_type.process_value(element) if element_outcome.success? array[index] = element_outcome.result else element_outcome.each_error do |error| error.prepend_path!(index) errors << error end end end Outcome.new(result: array, errors:) end |