Class: Heatmap::Area
- Inherits:
-
Object
- Object
- Heatmap::Area
- Defined in:
- lib/heatmap/area.rb
Instance Attribute Summary collapse
-
#alpha ⇒ Object
readonly
Returns the value of attribute alpha.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x, y, alpha = 1) ⇒ Area
constructor
A new instance of Area.
- #x_y ⇒ Object
Constructor Details
#initialize(x, y, alpha = 1) ⇒ Area
Returns a new instance of Area.
6 7 8 9 |
# File 'lib/heatmap/area.rb', line 6 def initialize(x, y, alpha = 1) raise(ArgumentError, "The x, y, alpha values need to be >= 0") if x < 0 || y < 0 || alpha < 0 @x, @y, @alpha = x, y, alpha end |
Instance Attribute Details
#alpha ⇒ Object (readonly)
Returns the value of attribute alpha.
4 5 6 |
# File 'lib/heatmap/area.rb', line 4 def alpha @alpha end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
4 5 6 |
# File 'lib/heatmap/area.rb', line 4 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
4 5 6 |
# File 'lib/heatmap/area.rb', line 4 def y @y end |
Instance Method Details
#x_y ⇒ Object
11 12 13 |
# File 'lib/heatmap/area.rb', line 11 def x_y "+#{x}+#{y}" end |