Class: PREP::Core::Region
- Inherits:
-
Object
- Object
- PREP::Core::Region
- Defined in:
- lib/core/region.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x, y, width, height) ⇒ Region
constructor
A new instance of Region.
- #to_s ⇒ Object
Constructor Details
#initialize(x, y, width, height) ⇒ Region
Returns a new instance of Region.
17 18 19 20 21 22 23 |
# File 'lib/core/region.rb', line 17 def initialize(x, y, width, height) self.x = x self.y = y self.width = width self.height = height end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
15 16 17 |
# File 'lib/core/region.rb', line 15 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
15 16 17 |
# File 'lib/core/region.rb', line 15 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
15 16 17 |
# File 'lib/core/region.rb', line 15 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
15 16 17 |
# File 'lib/core/region.rb', line 15 def y @y end |
Instance Method Details
#to_s ⇒ Object
49 50 51 |
# File 'lib/core/region.rb', line 49 def to_s "[x=#{x},y=#{y},w=#{width},h=#{height}]" end |