Class: Geometer::Rectangle
- Inherits:
-
Struct
- Object
- Struct
- Geometer::Rectangle
- Defined in:
- lib/geometer/rectangle.rb
Instance Attribute Summary collapse
-
#dimensions ⇒ Object
Returns the value of attribute dimensions.
-
#origin ⇒ Object
Returns the value of attribute origin.
Instance Method Summary collapse
Instance Attribute Details
#dimensions ⇒ Object
Returns the value of attribute dimensions
2 3 4 |
# File 'lib/geometer/rectangle.rb', line 2 def dimensions @dimensions end |
#origin ⇒ Object
Returns the value of attribute origin
2 3 4 |
# File 'lib/geometer/rectangle.rb', line 2 def origin @origin end |
Instance Method Details
#area ⇒ Object
7 8 9 |
# File 'lib/geometer/rectangle.rb', line 7 def area dimensions.area end |
#contains?(position) ⇒ Boolean
3 4 5 |
# File 'lib/geometer/rectangle.rb', line 3 def contains?(position) dimensions.contains?(position.translate(-origin)) end |