Module: Nibbler::DataProcessor
Overview
Accepts various types of input and returns an array of hex digit chars
Ideally this would output Integer objects. However, given that Ruby numerics 0x0 and 0x00 result in the same object (0 Integer), this would limit the parser to only working with bytes instead of both nibbles and bytes.
For example, if the input were “5” then the processor would return an ambiguous 0x5
Instance Method Summary collapse
-
#process(*args) ⇒ Array<String>
Accepts various types of input and returns an array of hex digit chars Invalid input is disregarded.
Instance Method Details
#process(*args) ⇒ Array<String>
Accepts various types of input and returns an array of hex digit chars Invalid input is disregarded
19 20 21 |
# File 'lib/nibbler/data_processor.rb', line 19 def process(*args) args.map { |arg| convert(arg) }.flatten.compact.map(&:upcase) end |