Class: Griddle::Rectangle
- Inherits:
-
Struct
- Object
- Struct
- Griddle::Rectangle
- Defined in:
- lib/griddle/rectangle.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#left ⇒ Object
Returns the value of attribute left.
-
#top ⇒ Object
Returns the value of attribute top.
-
#width ⇒ Object
Returns the value of attribute width.
Class Method Summary collapse
-
.create(top_left, bottom_right) ⇒ Object
include Comparable.
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height
2 3 4 |
# File 'lib/griddle/rectangle.rb', line 2 def height @height end |
#left ⇒ Object
Returns the value of attribute left
2 3 4 |
# File 'lib/griddle/rectangle.rb', line 2 def left @left end |
#top ⇒ Object
Returns the value of attribute top
2 3 4 |
# File 'lib/griddle/rectangle.rb', line 2 def top @top end |
#width ⇒ Object
Returns the value of attribute width
2 3 4 |
# File 'lib/griddle/rectangle.rb', line 2 def width @width end |
Class Method Details
.create(top_left, bottom_right) ⇒ Object
include Comparable
5 6 7 |
# File 'lib/griddle/rectangle.rb', line 5 def self.create(top_left, bottom_right) top_left.to_rectangle(bottom_right) end |