Class: Base::Crop
- Inherits:
-
Object
- Object
- Base::Crop
- Defined in:
- lib/base/models/crop.rb
Overview
Class for the crop data.
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#top ⇒ Object
readonly
Returns the value of attribute top.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(width:, height:, left:, top:) ⇒ Crop
constructor
A new instance of Crop.
- #to_s ⇒ Object
Constructor Details
#initialize(width:, height:, left:, top:) ⇒ Crop
Returns a new instance of Crop.
11 12 13 14 15 16 |
# File 'lib/base/models/crop.rb', line 11 def initialize(width:, height:, left:, top:) @height = height @width = width @left = left @top = top end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
6 7 8 |
# File 'lib/base/models/crop.rb', line 6 def height @height end |
#left ⇒ Object (readonly)
Returns the value of attribute left.
8 9 10 |
# File 'lib/base/models/crop.rb', line 8 def left @left end |
#top ⇒ Object (readonly)
Returns the value of attribute top.
9 10 11 |
# File 'lib/base/models/crop.rb', line 9 def top @top end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
7 8 9 |
# File 'lib/base/models/crop.rb', line 7 def width @width end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/base/models/crop.rb', line 18 def to_s [@width, @height, @left, @top].join('_') end |