Class: Revolut::Client

Overview

Wrapper class for all actions.

Instance Method Summary collapse

Methods included from Revolut::Clients::Webhooks

#create_webhook

Methods included from Revolut::Clients::Payments

#cancel_transaction, #pay, #transaction, #transactions, #transfer

Methods included from Revolut::Clients::PaymentDrafts

#create_payment_draft, #delete_payment_draft, #payment_draft, #payment_drafts

Methods included from Revolut::Clients::Exchanges

#exchange, #exchange_rate

Methods included from Revolut::Clients::Counterparties

#add_counterparty, #counterparties, #counterparty, #delete_counterparty

Methods included from Revolut::Clients::Accounts

#account, #account_details, #accounts

Constructor Details

#initialize(options = {}) ⇒ Client

Initialize client.

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :api_key (String)

    API Key provider from Revlut.

  • :environment (String)

    Environment (Production/Sanbox).



28
29
30
31
# File 'lib/revolut/client.rb', line 28

def initialize(options = {})
  config.api_key = options[:api_key] if options[:api_key]
  config.environment = options[:environment] if options[:environment]
end

Instance Method Details

#configConfiguration Also known as: configuration

Returns:



34
35
36
# File 'lib/revolut/client.rb', line 34

def config
  @config ||= Configuration.new
end

#configure {|config| ... } ⇒ Object

Configure client with a block of settings.

Yields:



40
41
42
43
# File 'lib/revolut/client.rb', line 40

def configure
  yield(config) if block_given?
  true
end

#connectionConnection

Returns:



46
47
48
# File 'lib/revolut/client.rb', line 46

def connection
  @connection ||= Connection.new(self)
end