Class: Huffify::HuffNode
- Inherits:
-
Object
- Object
- Huffify::HuffNode
- Defined in:
- lib/huffify.rb
Instance Attribute Summary collapse
-
#char ⇒ Object
Returns the value of attribute char.
-
#frequency ⇒ Object
Returns the value of attribute frequency.
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
Instance Method Summary collapse
-
#initialize(char, frequency, left = nil, right = nil) ⇒ HuffNode
constructor
A new instance of HuffNode.
Constructor Details
#initialize(char, frequency, left = nil, right = nil) ⇒ HuffNode
Returns a new instance of HuffNode.
9 10 11 12 13 14 |
# File 'lib/huffify.rb', line 9 def initialize(char, frequency, left = nil, right = nil) @char = char @frequency = frequency @left = left @right = right end |
Instance Attribute Details
#char ⇒ Object
Returns the value of attribute char.
7 8 9 |
# File 'lib/huffify.rb', line 7 def char @char end |
#frequency ⇒ Object
Returns the value of attribute frequency.
7 8 9 |
# File 'lib/huffify.rb', line 7 def frequency @frequency end |
#left ⇒ Object
Returns the value of attribute left.
7 8 9 |
# File 'lib/huffify.rb', line 7 def left @left end |
#right ⇒ Object
Returns the value of attribute right.
7 8 9 |
# File 'lib/huffify.rb', line 7 def right @right end |