Class: IIIF::Image::Region::Percent
- Inherits:
-
Object
- Object
- IIIF::Image::Region::Percent
- Defined in:
- lib/iiif/image/region/percent.rb
Overview
represents request cooridnates specified as percentage
Instance Attribute Summary collapse
-
#height_pct ⇒ Object
readonly
Returns the value of attribute height_pct.
-
#width_pct ⇒ Object
readonly
Returns the value of attribute width_pct.
-
#x_pct ⇒ Object
readonly
Returns the value of attribute x_pct.
-
#y_pct ⇒ Object
readonly
Returns the value of attribute y_pct.
Instance Method Summary collapse
-
#initialize(x, y, width, height) ⇒ Percent
constructor
A new instance of Percent.
- #to_s ⇒ Object
Constructor Details
#initialize(x, y, width, height) ⇒ Percent
Returns a new instance of Percent.
9 10 11 12 13 14 |
# File 'lib/iiif/image/region/percent.rb', line 9 def initialize(x, y, width, height) @x_pct = x @y_pct = y @width_pct = width @height_pct = height end |
Instance Attribute Details
#height_pct ⇒ Object (readonly)
Returns the value of attribute height_pct.
16 17 18 |
# File 'lib/iiif/image/region/percent.rb', line 16 def height_pct @height_pct end |
#width_pct ⇒ Object (readonly)
Returns the value of attribute width_pct.
16 17 18 |
# File 'lib/iiif/image/region/percent.rb', line 16 def width_pct @width_pct end |
#x_pct ⇒ Object (readonly)
Returns the value of attribute x_pct.
16 17 18 |
# File 'lib/iiif/image/region/percent.rb', line 16 def x_pct @x_pct end |
#y_pct ⇒ Object (readonly)
Returns the value of attribute y_pct.
16 17 18 |
# File 'lib/iiif/image/region/percent.rb', line 16 def y_pct @y_pct end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/iiif/image/region/percent.rb', line 18 def to_s "pct:#{x_pct},#{y_pct},#{width_pct},#{height_pct}" end |