Class: Klue::Langcraft::DSL::Processors::FullNameProcessor

Inherits:
Processor
  • Object
show all
Defined in:
lib/klue/langcraft/dsl/processors/full_name_processor.rb

Overview

FullNameProcessor class for processing full name data

This processor is responsible for handling full name processing operations within the DSL. It inherits from the base Processor class and implements specific logic for full name-related processing.

Instance Attribute Summary

Attributes inherited from Processor

#data, #key

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Processor

#build_result, #initialize

Constructor Details

This class inherits a constructor from Klue::Langcraft::DSL::Processors::Processor

Class Method Details

.keysObject



13
14
15
# File 'lib/klue/langcraft/dsl/processors/full_name_processor.rb', line 13

def self.keys
  [:full_name] # FullNameProcessor's specific key(s)
end

Instance Method Details

#build_result_dataObject

Implementation of logic for building full name data



18
19
20
21
22
23
24
25
26
# File 'lib/klue/langcraft/dsl/processors/full_name_processor.rb', line 18

def build_result_data
  first_name = data['first_name'] || 'John'
  last_name = data['last_name'] || 'Doe'
  full_name = "#{first_name} #{last_name}"

  {
    full_name: full_name
  }
end