Module: Encoder
Overview
Encode data with RLE.
Constant Summary
Constants included from Constants
Constants::CHUNK_KEY, Constants::COUNT_KEY
Instance Method Summary collapse
-
#encode(data, separator = "") ⇒ Array<Hash{ Symbol => Object }>
Check and then pass data to the actual encoder.
Instance Method Details
#encode(data, separator = "") ⇒ Array<Hash{ Symbol => Object }>
Check and then pass data to the actual encoder.
31 32 33 34 35 36 37 |
# File 'lib/run_length_encoding/encoder.rb', line 31 def encode(data, separator = "") valid_data, ex_details = _check_enc_data(data, separator) raise(ex_details[:ex_type], ex_details[:ex_msg]) if ex_details _encode(valid_data) end |