Class: IIIF::Image::Region::Absolute
- Inherits:
-
Object
- Object
- IIIF::Image::Region::Absolute
- Defined in:
- lib/iiif/image/region/absolute.rb
Overview
Represents an absolute specified region
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#offset_x ⇒ Object
readonly
Returns the value of attribute offset_x.
-
#offset_y ⇒ Object
readonly
Returns the value of attribute offset_y.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #dimensions ⇒ Object
-
#initialize(x, y, width, height) ⇒ Absolute
constructor
A new instance of Absolute.
- #to_s ⇒ Object
Constructor Details
#initialize(x, y, width, height) ⇒ Absolute
Returns a new instance of Absolute.
9 10 11 12 13 14 |
# File 'lib/iiif/image/region/absolute.rb', line 9 def initialize(x, y, width, height) @offset_x = x @offset_y = y @width = width @height = height end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
16 17 18 |
# File 'lib/iiif/image/region/absolute.rb', line 16 def height @height end |
#offset_x ⇒ Object (readonly)
Returns the value of attribute offset_x.
16 17 18 |
# File 'lib/iiif/image/region/absolute.rb', line 16 def offset_x @offset_x end |
#offset_y ⇒ Object (readonly)
Returns the value of attribute offset_y.
16 17 18 |
# File 'lib/iiif/image/region/absolute.rb', line 16 def offset_y @offset_y end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
16 17 18 |
# File 'lib/iiif/image/region/absolute.rb', line 16 def width @width end |
Instance Method Details
#dimensions ⇒ Object
18 19 20 |
# File 'lib/iiif/image/region/absolute.rb', line 18 def dimensions Dimension.new(width: width, height: height) end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/iiif/image/region/absolute.rb', line 22 def to_s "#{offset_x},#{offset_y},#{width},#{height}" end |