Sha256: 45afc52821e04e5ecc37b62fe2bf541772aa8c7f8cda70bd60b2300ce61c3bf3

Contents?: true

Size: 627 Bytes

Versions: 10

Compression:

Stored size: 627 Bytes

Contents

# frozen_string_literal: true

module Lokalise
  module Resources
    class File < Base
      class << self
        def download(client, path, params)
          post(path, client, params)['content']
        end

        def upload(client, path, params)
          klass = Lokalise::Resources::QueuedProcess
          klass.new post(path, client, params),
                    ->(project_id, id) { klass.endpoint(project_id, id) }
        end

        def endpoint(project_id, action = '')
          path_from projects: project_id,
                    files: action
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-lokalise-api-5.0.0 lib/ruby-lokalise-api/resources/file.rb
ruby-lokalise-api-4.5.1 lib/ruby-lokalise-api/resources/file.rb
ruby-lokalise-api-4.5.0 lib/ruby-lokalise-api/resources/file.rb
ruby-lokalise-api-4.4.0 lib/ruby-lokalise-api/resources/file.rb
ruby-lokalise-api-4.3.1 lib/ruby-lokalise-api/resources/file.rb
ruby-lokalise-api-4.3.0 lib/ruby-lokalise-api/resources/file.rb
ruby-lokalise-api-4.2.0 lib/ruby-lokalise-api/resources/file.rb
ruby-lokalise-api-4.1.0 lib/ruby-lokalise-api/resources/file.rb
ruby-lokalise-api-4.0.0 lib/ruby-lokalise-api/resources/file.rb
ruby-lokalise-api-3.1.0 lib/ruby-lokalise-api/resources/file.rb