Sha256: 1da376c261be6c887a5e8198347efbac479174a403b44784009caeadc8a695ff

Contents?: true

Size: 1.48 KB

Versions: 20

Compression:

Stored size: 1.48 KB

Contents

module Fog
  module Google
    class Storage
      class Real

        # Get an expiring object url from Google Storage for putting an object
        #
        # ==== Parameters
        # * bucket_name<~String> - Name of bucket containing object
        # * object_name<~String> - Name of object to get expiring url for
        # * expires<~Time> - An expiry time for this url
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~String> - url for object
        #
        def put_object_url(bucket_name, object_name, expires)
          unless bucket_name
            raise ArgumentError.new('bucket_name is required')
          end
          unless object_name
            raise ArgumentError.new('object_name is required')
          end
          url({
            :headers  => {},
            :host     => @host,
            :method   => 'PUT',
            :path     => "#{bucket_name}/#{object_name}"
          }, expires)
        end

      end

      class Mock

        def put_object_url(bucket_name, object_name, expires)
          unless bucket_name
            raise ArgumentError.new('bucket_name is required')
          end
          unless object_name
            raise ArgumentError.new('object_name is required')
          end
          url({
            :headers  => {},
            :host     => @host,
            :method   => 'PUT',
            :path     => "#{bucket_name}/#{object_name}"
          }, expires)
        end

      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
fog-0.8.2 lib/fog/storage/requests/google/put_object_url.rb
fog-0.8.1 lib/fog/storage/requests/google/put_object_url.rb
fog-0.8.0 lib/fog/storage/requests/google/put_object_url.rb
fog-0.7.2 lib/fog/storage/requests/google/put_object_url.rb
fog-0.7.1 lib/fog/storage/requests/google/put_object_url.rb
fog-0.7.0 lib/fog/storage/requests/google/put_object_url.rb
fog-0.6.0 lib/fog/storage/requests/google/put_object_url.rb
fog-0.5.3 lib/fog/storage/requests/google/put_object_url.rb
fog-0.5.2 lib/fog/storage/requests/google/put_object_url.rb
fog-0.5.1 lib/fog/storage/requests/google/put_object_url.rb
fog-0.5.0 lib/fog/storage/requests/google/put_object_url.rb
phpfog-fog-0.4.1.3 lib/fog/storage/requests/google/put_object_url.rb
phpfog-fog-0.4.1.2 lib/fog/storage/requests/google/put_object_url.rb
phpfog-fog-0.4.1.1 lib/fog/storage/requests/google/put_object_url.rb
phpfog-fog-0.4.1 lib/fog/storage/requests/google/put_object_url.rb
fog-0.4.1 lib/fog/storage/requests/google/put_object_url.rb
fog-0.4.0 lib/fog/google/requests/storage/put_object_url.rb
fog-0.3.34 lib/fog/google/requests/storage/put_object_url.rb
fog-0.3.33 lib/fog/google/requests/storage/put_object_url.rb
fog-0.3.32 lib/fog/google/requests/storage/put_object_url.rb