Class: Gradient::ColorPoint
- Inherits:
-
Object
- Object
- Gradient::ColorPoint
- Defined in:
- lib/gradient/color_point.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(location, color) ⇒ ColorPoint
constructor
A new instance of ColorPoint.
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
#color ⇒ Object (readonly)
Returns the value of attribute color.
3 4 5 |
# File 'lib/gradient/color_point.rb', line 3 def color @color end |
#location ⇒ Object (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 |