Sha256: 0ea0e3c99280f1cb0f020370efb05173a5392f6ddc8032a10b2849438ea9728f

Contents?: true

Size: 870 Bytes

Versions: 10

Compression:

Stored size: 870 Bytes

Contents

module Paddle
  class Business < Object

    class << self

      def list(customer:, **params)
        response = Client.get_request("customers/#{customer}/businesses", params: params)
        Collection.from_response(response, type: Business)
      end

      def create(customer:, name:, **params)
        attrs = {name: name}
        response = Client.post_request("customers/#{customer}/businesses", body: attrs.merge(params))
        Business.new(response.body["data"])
      end

      def retrieve(customer:, id:)
        response = Client.get_request("customers/#{customer}/businesses/#{id}")
        Business.new(response.body["data"])
      end

      def update(customer:, id:, **params)
        response = Client.patch_request("customers/#{customer}/businesses/#{id}", body: params)
        Business.new(response.body["data"])
      end

    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
paddle-2.2.0 lib/paddle/models/business.rb
paddle-2.1.4 lib/paddle/models/business.rb
paddle-2.1.3 lib/paddle/models/business.rb
paddle-2.1.2 lib/paddle/models/business.rb
paddle-2.1.1 lib/paddle/models/business.rb
paddle-2.1.0 lib/paddle/models/business.rb
paddle-2.0.0 lib/paddle/models/business.rb
paddle-1.1.2 lib/paddle/models/business.rb
paddle-1.1.1 lib/paddle/models/business.rb
paddle-1.1.0 lib/paddle/models/business.rb