Sha256: 15c82ed4728919c51ad37f2f1fe132c1a0fce5d2aeef0b9b8005e36ed6610b49

Contents?: true

Size: 907 Bytes

Versions: 3

Compression:

Stored size: 907 Bytes

Contents

module FinApps
  module REST
    class Client < BaseClient # :nodoc:
      include FinApps::REST::Defaults

      # @param [String] tenant_identifier
      # @param [String] tenant_token
      # @param [Hash] options
      # @return [FinApps::REST::Client]
      def initialize(tenant_identifier, tenant_token, logger=nil, options={})
        raise FinApps::MissingArgumentsError.new 'Invalid company_identifier.' if tenant_identifier.blank?
        raise FinApps::MissingArgumentsError.new 'Invalid company_token.' if tenant_token.blank?

        merged_options = FinApps::REST::Defaults::DEFAULTS.merge options
        merged_options[:tenant_credentials] = {identifier: tenant_identifier,
                                               token:      tenant_token}

        super(merged_options, logger)
      end

      def users
        @users ||= FinApps::REST::Users.new self
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
finapps-2.0.4 lib/finapps/rest/client.rb
finapps-2.0.3 lib/finapps/rest/client.rb
finapps-2.0.2 lib/finapps/rest/client.rb