Class: Gradient::ColorPoint

Inherits:
Object
  • Object
show all
Defined in:
lib/gradient/color_point.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location, color) ⇒ ColorPoint

Returns a new instance of ColorPoint.



4
5
6
# File 'lib/gradient/color_point.rb', line 4

def initialize(location, color)
  @color, @location = color, location
end

Instance Attribute Details

#colorObject (readonly)

Returns the value of attribute color.



3
4
5
# File 'lib/gradient/color_point.rb', line 3

def color
  @color
end

#locationObject (readonly)

Returns the value of attribute location.



3
4
5
# File 'lib/gradient/color_point.rb', line 3

def location
  @location
end

Instance Method Details

#<=>(other) ⇒ Object



7
8
9
# File 'lib/gradient/color_point.rb', line 7

def <=>(other)
  self.location <=> other.location
end