Module: Bunq

Defined in:
lib/bunq/client.rb,
lib/bunq/card.rb,
lib/bunq/user.rb,
lib/bunq/cards.rb,
lib/bunq/users.rb,
lib/bunq/avatar.rb,
lib/bunq/errors.rb,
lib/bunq/header.rb,
lib/bunq/avatars.rb,
lib/bunq/payment.rb,
lib/bunq/version.rb,
lib/bunq/payments.rb,
lib/bunq/resource.rb,
lib/bunq/encryptor.rb,
lib/bunq/paginated.rb,
lib/bunq/signature.rb,
lib/bunq/attachment.rb,
lib/bunq/bunqme_tab.rb,
lib/bunq/attachments.rb,
lib/bunq/bunqme_tabs.rb,
lib/bunq/user_person.rb,
lib/bunq/installation.rb,
lib/bunq/user_company.rb,
lib/bunq/installations.rb,
lib/bunq/device_servers.rb,
lib/bunq/qr_code_content.rb,
lib/bunq/session_servers.rb,
lib/bunq/monetary_account.rb,
lib/bunq/attachment_public.rb,
lib/bunq/monetary_accounts.rb,
lib/bunq/attachment_publics.rb,
lib/bunq/certificate_pinned.rb,
lib/bunq/monetary_account_bank.rb,
lib/bunq/monetary_account_banks.rb,
lib/bunq/draft_share_invite_bank.rb,
lib/bunq/notification_filter_url.rb,
lib/bunq/draft_share_invite_banks.rb,
lib/bunq/attachment_public_content.rb

Overview

Usage

Bunq.configure do |config|
  config.api_key = 'YOUR_APIKEY'
  config.installation_token = 'YOUR_INSTALLATION_TOKEN'
  config.private_key = 'YOUR PRIVATE KEY'
  config.server_public_key = 'SERVER PUBLIC KEY'
end

client = Bunq.client
number_of_accounts = client.me_as_user.monetary_accounts.index.to_a.count
puts "User has #{number_of_accounts} accounts"

Defined Under Namespace

Modules: Header Classes: AbsentResponseSignature, Attachment, AttachmentPublic, AttachmentPublicContent, AttachmentPublics, Attachments, Avatar, Avatars, BunqmeTab, BunqmeTabs, Card, Cards, CertificatePinned, Client, Configuration, DeviceServers, DraftShareInviteBank, DraftShareInviteBanks, Encryptor, Installation, Installations, InvalidResponseSignature, MaintenanceResponse, MissingPaginationObject, MonetaryAccount, MonetaryAccountBank, MonetaryAccountBanks, MonetaryAccounts, NoSessionCache, NotificationFilterUrl, Paginated, Payment, Payments, QrCodeContent, Resource, ResourceNotFound, ResponseError, SessionServers, Signature, ThreadSafeSessionCache, Timeout, TooManyRequestsResponse, UnauthorisedResponse, UnexpectedResponse, User, UserCompany, UserPerson, Users

Constant Summary collapse

VERSION =
'1.0.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



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

def configuration
  @configuration
end

Class Method Details

.clientObject

Returns a new instance of Client with the current configuration.



62
63
64
65
66
# File 'lib/bunq/client.rb', line 62

def client
  fail 'No configuration! Call Bunq.configure first.' unless configuration

  Client.new(configuration.dup)
end

.configure {|configuration| ... } ⇒ Object

Yields:



48
49
50
51
52
53
# File 'lib/bunq/client.rb', line 48

def configure
  self.configuration ||= Configuration.new
  yield(configuration)

  configuration.base_url = Configuration::SANDBOX_BASE_URL if configuration.sandbox
end

.reset_configurationObject



55
56
57
# File 'lib/bunq/client.rb', line 55

def reset_configuration
  self.configuration = nil
end