Sha256: c687ac226c558439c844b8800e884d80c2514e4ad174413c17b87c9b7db2506a

Contents?: true

Size: 590 Bytes

Versions: 4

Compression:

Stored size: 590 Bytes

Contents

module PagarMe
  class Company < PagarMeObject
    def default_recipient
      PagarMe::Recipient.find default_recipient_by_env
    end

    protected
    def default_recipient_by_env
      if PagarMe.production?
        default_recipient_id.live
      else
        default_recipient_id.test
      end
    end

    def self.default_recipient
      company.default_recipient
    end

    def self.company
      PagarMe::Request.get('/company').call
    end

    def self.temporary(params = Hash.new)
      PagarMe::Request.post('/companies/temporary', params: params).call
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pagarme-2.4.0 lib/pagarme/resources/company.rb
pagarme-2.3.0 lib/pagarme/resources/company.rb
pagarme-2.2.3 lib/pagarme/resources/company.rb
pagarme-2.2.2 lib/pagarme/resources/company.rb