Sha256: 277e1d9b916f32c02ab24ee8a2fac3803f7fabefaf5fe897a2f21775e2adf4b4

Contents?: true

Size: 680 Bytes

Versions: 3

Compression:

Stored size: 680 Bytes

Contents

# frozen_string_literal: true

module Lokalise
  module Resources
    class Branch < Base
      supports :update, :destroy

      def merge(params = {})
        self.class.merge @client, self.class.endpoint(project_id, branch_id, :merge), params
      end

      class << self
        def merge(client, path, params, *_args)
          post(path, client, params)['content']
        end

        def endpoint(project_id, branch_id = nil, action = nil)
          params = {projects: project_id,
                    branches: branch_id}

          params[:merge] = '' if action == :merge

          path_from params
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-lokalise-api-2.10.0 lib/ruby-lokalise-api/resources/branch.rb
ruby-lokalise-api-2.9.0.1 lib/ruby-lokalise-api/resources/branch.rb
ruby-lokalise-api-2.9.0 lib/ruby-lokalise-api/resources/branch.rb