Class: ActiveadminSelleoCms::Asset

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/activeadmin_selleo_cms/asset.rb

Direct Known Subclasses

Attachment, Image

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cover_heightObject

Returns the value of attribute cover_height.



4
5
6
# File 'app/models/activeadmin_selleo_cms/asset.rb', line 4

def cover_height
  @cover_height
end

#cover_resize_methodObject

Returns the value of attribute cover_resize_method.



4
5
6
# File 'app/models/activeadmin_selleo_cms/asset.rb', line 4

def cover_resize_method
  @cover_resize_method
end

#cover_widthObject

Returns the value of attribute cover_width.



4
5
6
# File 'app/models/activeadmin_selleo_cms/asset.rb', line 4

def cover_width
  @cover_width
end

#crop_hObject

Returns the value of attribute crop_h.



4
5
6
# File 'app/models/activeadmin_selleo_cms/asset.rb', line 4

def crop_h
  @crop_h
end

#crop_wObject

Returns the value of attribute crop_w.



4
5
6
# File 'app/models/activeadmin_selleo_cms/asset.rb', line 4

def crop_w
  @crop_w
end

#crop_xObject

Returns the value of attribute crop_x.



4
5
6
# File 'app/models/activeadmin_selleo_cms/asset.rb', line 4

def crop_x
  @crop_x
end

#crop_yObject

Returns the value of attribute crop_y.



4
5
6
# File 'app/models/activeadmin_selleo_cms/asset.rb', line 4

def crop_y
  @crop_y
end

Instance Method Details

#cover_sizesObject



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

def cover_sizes
  { :normal => "#{cover_width || 120}x#{cover_height || 90}#{cover_resize_method || ">"}" }
end

#url(format = nil) ⇒ Object

validates_presence_of :assetable



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

def url(format=nil)
  data.url(format)
end