Sha256: c8eca0ec0b9c6b29594203b6d2755ea55723739bb4245663b609b27db191fbf9

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true
module FinApps
  module REST
    class Client < BaseClient # :nodoc:
      using ObjectExtensions
      using StringExtensions

      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, options={}, logger=nil)
        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.merge(tenant_identifier: tenant_identifier,
                                                                               tenant_token: tenant_token))
        super(merged_options, logger)
      end

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

      def order_tokens
        @order_tokens ||= FinApps::REST::OrderTokens.new self
      end

      def orders
        @orders ||= FinApps::REST::Orders.new self
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
finapps-2.0.16 lib/finapps/rest/client.rb
finapps-2.0.15 lib/finapps/rest/client.rb
finapps-2.0.14 lib/finapps/rest/client.rb
finapps-2.0.13 lib/finapps/rest/client.rb