Class: RunLengthEncodingRb::RLEElement

Inherits:
Object
  • Object
show all
Defined in:
lib/run_length_encoding_rb/rle_element.rb

Overview

Stores an run-length encoded element.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(chunk:, run_length:) ⇒ RLEElement

Returns a new instance of RLEElement.



10
11
12
13
# File 'lib/run_length_encoding_rb/rle_element.rb', line 10

def initialize(chunk:, run_length:)
  @chunk = chunk
  @run_length = run_length
end

Instance Attribute Details

#chunkObject

Returns the value of attribute chunk.



8
9
10
# File 'lib/run_length_encoding_rb/rle_element.rb', line 8

def chunk
  @chunk
end

#run_lengthObject

Returns the value of attribute run_length.



8
9
10
# File 'lib/run_length_encoding_rb/rle_element.rb', line 8

def run_length
  @run_length
end