Class: ClassMetrix::ValueProcessor
- Inherits:
-
Object
- Object
- ClassMetrix::ValueProcessor
- 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
- .expand_hash(hash) ⇒ Object
- .format_hash(hash) ⇒ Object
- .handle_extraction_error(error) ⇒ Object
- .missing_constant ⇒ Object
- .missing_method ⇒ Object
- .process(value, expand_hashes: false) ⇒ Object
Class Method Details
.expand_hash(hash) ⇒ Object
23 24 25 26 |
# File 'lib/class_metrix/processors/value_processor.rb', line 23 def self.(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_constant ⇒ Object
32 33 34 |
# File 'lib/class_metrix/processors/value_processor.rb', line 32 def self.missing_constant Formatters::Shared::ValueProcessor.missing_constant end |
.missing_method ⇒ Object
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 && value.is_a?(Hash) (value) else Formatters::Shared::ValueProcessor.process_for_markdown(value) end rescue StandardError => e "⚠️ #{e.class.name}" end |