Sha256: 8a6ceb52d7b569ffb1d90bb01a7579fa37a51837f75b4fbc4cbc220723471ca4

Contents?: true

Size: 506 Bytes

Versions: 2

Compression:

Stored size: 506 Bytes

Contents

module VzaarApi
  module Strategy
    module Image
      class Create < Abstract
        def execute
          path = attrs[:path]
          raise Error.new('Invalid parameters: path is missing') unless path

          File.open(path, "r") do |file|
            res = Lib::Api.new.post(url, image: file) do |body, headers|
              headers.delete('Content-Type')
              [body, headers]
            end

            video_class.new res.data
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vzaar_api-2.0.2 lib/vzaar_api/strategy/image/create.rb
vzaar_api-2.0.1 lib/vzaar_api/strategy/image/create.rb