Class: ClassMetrix::ValueProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/class_metrix/processors/value_processor.rb

Overview

Legacy value processor - now delegates to the new shared processor Maintained for backward compatibility with existing code

Class Method Summary collapse

Class Method Details

.expand_hash(hash) ⇒ Object



23
24
25
26
# File 'lib/class_metrix/processors/value_processor.rb', line 23

def self.expand_hash(hash)
  # Return an array of key-value pairs for expansion
  hash.map { |k, v| { key: k.to_s, value: process(v, expand_hashes: false) } }
end

.format_hash(hash) ⇒ Object



19
20
21
# File 'lib/class_metrix/processors/value_processor.rb', line 19

def self.format_hash(hash)
  Formatters::Shared::ValueProcessor.process_for_markdown(hash)
end

.handle_extraction_error(error) ⇒ Object



28
29
30
# File 'lib/class_metrix/processors/value_processor.rb', line 28

def self.handle_extraction_error(error)
  Formatters::Shared::ValueProcessor.handle_extraction_error(error)
end

.missing_constantObject



32
33
34
# File 'lib/class_metrix/processors/value_processor.rb', line 32

def self.missing_constant
  Formatters::Shared::ValueProcessor.missing_constant
end

.missing_methodObject



36
37
38
# File 'lib/class_metrix/processors/value_processor.rb', line 36

def self.missing_method
  Formatters::Shared::ValueProcessor.missing_method
end

.process(value, expand_hashes: false) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/class_metrix/processors/value_processor.rb', line 9

def self.process(value, expand_hashes: false)
  if expand_hashes && value.is_a?(Hash)
    expand_hash(value)
  else
    Formatters::Shared::ValueProcessor.process_for_markdown(value)
  end
rescue StandardError => e
  "⚠️ #{e.class.name}"
end