Class: Gradient::OpacityPoint

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(location, opacity) ⇒ OpacityPoint

Returns a new instance of OpacityPoint.



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

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



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

def location
  @location
end

#opacityObject (readonly)

Returns the value of attribute opacity.



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

def opacity
  @opacity
end

Instance Method Details

#<=>(other) ⇒ Object



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

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