class Humpyard::Assets::PaperclipAsset

Public Instance Methods

content_type() click to toggle source
# File app/models/humpyard/assets/paperclip_asset.rb, line 32
def content_type
  media_content_type
end
title() click to toggle source
# File app/models/humpyard/assets/paperclip_asset.rb, line 24
def title
  media_file_name
end
update_media_dimensions() click to toggle source
# File app/models/humpyard/assets/paperclip_asset.rb, line 36
def update_media_dimensions
  begin
    size = Paperclip::Geometry.from_file media.queued_for_write[:original]
    asset.width = size.width.to_i
    asset.height = size.height.to_i
  rescue
    asset.width = nil
    asset.height = nil
  end
end
url() click to toggle source
# File app/models/humpyard/assets/paperclip_asset.rb, line 28
def url
  media.url
end