Class: Mindee::Geometry::Point
- Inherits:
-
Object
- Object
- Mindee::Geometry::Point
- Defined in:
- lib/mindee/geometry/point.rb
Overview
A relative set of coordinates (X, Y) on the document.
Instance Attribute Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Float
-
#initialize(x, y) ⇒ Point
constructor
A new instance of Point.
Constructor Details
#initialize(x, y) ⇒ Point
Returns a new instance of Point.
17 18 19 20 |
# File 'lib/mindee/geometry/point.rb', line 17 def initialize(x, y) @x = x @y = y end |
Instance Attribute Details
#x ⇒ Float
9 10 11 |
# File 'lib/mindee/geometry/point.rb', line 9 def x @x end |
#y ⇒ Float
11 12 13 |
# File 'lib/mindee/geometry/point.rb', line 11 def y @y end |
Instance Method Details
#[](key) ⇒ Float
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/mindee/geometry/point.rb', line 24 def [](key) case key when 0 @x when 1 @y else throw '0 or 1 only' end end |