Sha256: 2e5325e8ba20f50c2503d029e7cf0f73cf7d9c774949ecddfffb41a8b750b911

Contents?: true

Size: 638 Bytes

Versions: 8

Compression:

Stored size: 638 Bytes

Contents

module Billimatic
  module Resources
    class Company < Base
      crud :list, :show, :create, :destroy

      def initialize(http)
        @collection_name = 'companies'
        super(http)
      end

      # GET /api/v1/companies/search
      def search(cnpj)
        http.get("#{resource_base_path}/search", params: {cnpj: cnpj}) do |response|
          respond_with_collection(response)
        end
      end

      # PATCH /api/v1/companies/:id
      def update(id, params)
        http.patch("#{resource_base_path}/#{id}", body: params) do |response|
          respond_with_entity(response)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
billimatic-client-1.0.1 lib/billimatic/resources/company.rb
billimatic-client-1.0.0 lib/billimatic/resources/company.rb
billimatic-client-0.22.1 lib/billimatic/resources/company.rb
billimatic-client-0.22.0 lib/billimatic/resources/company.rb
billimatic-client-0.21.0 lib/billimatic/resources/company.rb
billimatic-client-0.20.0 lib/billimatic/resources/company.rb
billimatic-client-0.19.1 lib/billimatic/resources/company.rb
billimatic-client-0.19.0 lib/billimatic/resources/company.rb