Class: Squish::Node

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/squish.rb

Overview

Originally written by Aggelos Orfanakos

Direct Known Subclasses

Internal, Leaf

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(weight) ⇒ Node

Returns a new instance of Node.



322
323
324
# File 'lib/squish.rb', line 322

def initialize(weight)
  @weight = weight
end

Instance Attribute Details

#weightObject (readonly)

Returns the value of attribute weight.



320
321
322
# File 'lib/squish.rb', line 320

def weight
  @weight
end

Instance Method Details

#<=>(other) ⇒ Object



326
327
328
# File 'lib/squish.rb', line 326

def <=>(other)
  other.weight <=> @weight
end