Class: ActiveadminSelleoCms::Image

Inherits:
Asset
  • Object
show all
Defined in:
app/models/activeadmin_selleo_cms/image.rb

Instance Attribute Summary collapse

Attributes inherited from Asset

#cover_height, #cover_resize_method, #cover_width, #crop_h, #crop_w, #crop_x, #crop_y

Instance Method Summary collapse

Methods inherited from Asset

#cover_sizes, #url

Instance Attribute Details

#image_heightObject

Returns the value of attribute image_height.



3
4
5
# File 'app/models/activeadmin_selleo_cms/image.rb', line 3

def image_height
  @image_height
end

#image_widthObject

Returns the value of attribute image_width.



3
4
5
# File 'app/models/activeadmin_selleo_cms/image.rb', line 3

def image_width
  @image_width
end

#resize_methodObject

Returns the value of attribute resize_method.



3
4
5
# File 'app/models/activeadmin_selleo_cms/image.rb', line 3

def resize_method
  @resize_method
end

Instance Method Details

#cropping?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/models/activeadmin_selleo_cms/image.rb', line 19

def cropping?
  !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?
end

#image_sizesObject



23
24
25
# File 'app/models/activeadmin_selleo_cms/image.rb', line 23

def image_sizes
  { :normal => "#{image_width || 640}x#{image_height || 480}#{resize_method || ">"}" }
end