Module: Nibbler::HexProcessor

Extended by:
HexProcessor
Included in:
HexProcessor
Defined in:
lib/nibbler/hex_processor.rb

Overview

Accepts various types of input and returns an array of hex digit chars

Instance Method Summary collapse

Instance Method Details

#process(*args) ⇒ Array<String>

Accepts various types of input and returns an array of hex digit chars Invalid input is disregarded

Parameters:

  • args (*String, *Fixnum)

Returns:

  • (Array<String>)

    An array of hex string nibbles eg “6”, “a”



13
14
15
# File 'lib/nibbler/hex_processor.rb', line 13

def process(*args)
  args.map { |arg| convert(arg) }.flatten.compact.map(&:upcase) 
end