Class: RunLengthEncodingRb::Encoder
- Inherits:
-
Object
- Object
- RunLengthEncodingRb::Encoder
- Defined in:
- lib/run_length_encoding_rb/encoder.rb
Overview
Encode data with RLE.
Instance Method Summary collapse
-
#encode(data, separator = "") ⇒ Array<::RLEElement>
Encode an array with the run-length encoding.
Instance Method Details
#encode(data, separator = "") ⇒ Array<::RLEElement>
Encode an array with the run-length encoding.
20 21 22 23 24 25 26 |
# File 'lib/run_length_encoding_rb/encoder.rb', line 20 def encode(data, separator = "") array = _to_array(data, separator) _raise_on_unsupported_type(data.class) unless array _encode(array) end |