Class: Base::Crop

Inherits:
Object
  • Object
show all
Defined in:
lib/base/models/crop.rb

Overview

Class for the crop data.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#heightObject (readonly)

Returns the value of attribute height.



6
7
8
# File 'lib/base/models/crop.rb', line 6

def height
  @height
end

#leftObject (readonly)

Returns the value of attribute left.



8
9
10
# File 'lib/base/models/crop.rb', line 8

def left
  @left
end

#topObject (readonly)

Returns the value of attribute top.



9
10
11
# File 'lib/base/models/crop.rb', line 9

def top
  @top
end

#widthObject (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_sObject



18
19
20
# File 'lib/base/models/crop.rb', line 18

def to_s
  [@width, @height, @left, @top].join('_')
end