Class: ActiveadminSelleoCms::Asset
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ActiveadminSelleoCms::Asset
- Defined in:
- app/models/activeadmin_selleo_cms/asset.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cover_height ⇒ Object
Returns the value of attribute cover_height.
-
#cover_resize_method ⇒ Object
Returns the value of attribute cover_resize_method.
-
#cover_width ⇒ Object
Returns the value of attribute cover_width.
-
#crop_h ⇒ Object
Returns the value of attribute crop_h.
-
#crop_w ⇒ Object
Returns the value of attribute crop_w.
-
#crop_x ⇒ Object
Returns the value of attribute crop_x.
-
#crop_y ⇒ Object
Returns the value of attribute crop_y.
Instance Method Summary collapse
- #cover_sizes ⇒ Object
-
#url(format = nil) ⇒ Object
validates_presence_of :assetable.
Instance Attribute Details
#cover_height ⇒ Object
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_method ⇒ Object
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_width ⇒ Object
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_h ⇒ Object
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_w ⇒ Object
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_x ⇒ Object
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_y ⇒ Object
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_sizes ⇒ Object
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 |