Sha256: d814a8837ff49a61ad7c3502b2c307e1b933f626c7cc60057908037d71982e79

Contents?: true

Size: 1.16 KB

Versions: 48

Compression:

Stored size: 1.16 KB

Contents

# encoding: utf-8

module CarrierWave
  module Uploader
    module Proxy

      ##
      # === Returns
      #
      # [Boolean] Whether the uploaded file is blank
      #
      def blank?
        file.blank?
      end

      ##
      # === Returns
      #
      # [String] the path where the file is currently located.
      #
      def current_path
        file.path if file.respond_to?(:path)
      end

      alias_method :path, :current_path

      ##
      # Returns a string that uniquely identifies the last stored file
      #
      # === Returns
      #
      # [String] uniquely identifies a file
      #
      def identifier
        storage.identifier if storage.respond_to?(:identifier)
      end

      ##
      # Read the contents of the file
      #
      # === Returns
      #
      # [String] contents of the file
      #
      def read
        file.read if file.respond_to?(:read)
      end

      ##
      # Fetches the size of the currently stored/cached file
      #
      # === Returns
      #
      # [Integer] size of the file
      #
      def size
        file.respond_to?(:size) ? file.size : 0
      end

    end # Proxy
  end # Uploader
end # CarrierWave

Version data entries

48 entries across 48 versions & 10 rubygems

Version Path
andrewtimberlake-carrierwave-0.3.2.1 lib/carrierwave/uploader/proxy.rb
durran-carrierwave-0.3.2.3 lib/carrierwave/uploader/proxy.rb
jnicklas-carrierwave-0.3.2.1 lib/carrierwave/uploader/proxy.rb
jnicklas-carrierwave-0.3.2 lib/carrierwave/uploader/proxy.rb
jnicklas-carrierwave-0.3.3 lib/carrierwave/uploader/proxy.rb
carrierwave-0.5.4 lib/carrierwave/uploader/proxy.rb
carrierwave-0.5.3 lib/carrierwave/uploader/proxy.rb
locomotive_carrierwave-0.5.0.1.beta3 lib/carrierwave/uploader/proxy.rb
carrierwave-0.5.2 lib/carrierwave/uploader/proxy.rb
carrierwave-0.5.1 lib/carrierwave/uploader/proxy.rb
thorsson_carrierwave-0.4.12 lib/carrierwave/uploader/proxy.rb
thorsson_carrierwave-0.4.11 lib/carrierwave/uploader/proxy.rb
thorsson_carrierwave-0.4.10 lib/carrierwave/uploader/proxy.rb
thorsson_carrierwave-0.4.9 lib/carrierwave/uploader/proxy.rb
thorsson_carrierwave-0.4.8 lib/carrierwave/uploader/proxy.rb
thorsson_carrierwave-0.4.6 lib/carrierwave/uploader/proxy.rb
thorsson_carrierwave-0.4.5 lib/carrierwave/uploader/proxy.rb
locomotive_carrierwave-0.5.0.1.beta2 lib/carrierwave/uploader/proxy.rb
locomotive_carrierwave-0.5.0.1.beta1 lib/carrierwave/uploader/proxy.rb
locomotive_carrierwave-0.5.0.1 lib/carrierwave/uploader/proxy.rb