Sha256: 66f5d2e0b4287243efa665853421c2036c264cae3d30bc501e281a5b083bb5a1
Contents?: true
Size: 759 Bytes
Versions: 9
Compression:
Stored size: 759 Bytes
Contents
# encoding: utf-8 module CarrierWave module Uploader module Url ## # === Returns # # [String] the location where this file is accessible via a url # def url if file.respond_to?(:url) and not file.url.blank? file.url elsif current_path File.expand_path(current_path).gsub(File.expand_path(root), '') end end alias_method :to_s, :url ## # === Returns # # [String] A JSON serialization containing this uploader's URL(s) # def as_json(options = nil) h = { :url => url } h.merge Hash[versions.map { |name, version| [name, { :url => version.url }] }] end end # Url end # Uploader end # CarrierWave
Version data entries
9 entries across 9 versions & 3 rubygems