Class: Image::Transform

Inherits:
BaseFormObject show all
Defined in:
app/forms/image/transform.rb

Overview

Form object for image transformations (resize, crop, rotate, reformat)
submitted by the image editor.

Instance Method Summary collapse

Methods inherited from BaseFormObject

#attributes, #initialize, #persisted?

Constructor Details

This class inherits a constructor from BaseFormObject

Instance Method Details

#to_crop_dataHash{Symbol => Integer}

Crop parameters as a hash, with unset values removed.

Returns:

  • (Hash{Symbol => Integer})

    crop x, y, width, and height



21
22
23
24
25
26
27
28
# File 'app/forms/image/transform.rb', line 21

def to_crop_data
  {
    x: crop_x,
    y: crop_y,
    width: crop_w,
    height: crop_h
  }.compact
end