Class: Tikkie::Api::Responses::User

Inherits:
Base
  • Object
show all
Defined in:
lib/tikkie/api/responses/user.rb

Overview

Response when requesting an user.

Instance Attribute Summary

Attributes inherited from Base

#data, #response

Instance Method Summary collapse

Methods inherited from Base

#error?, #errors, #initialize, #response_code, #success?, #trace_id

Constructor Details

This class inherits a constructor from Tikkie::Api::Responses::Base

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/tikkie/api/responses/user.rb', line 21

def active?
  status == Tikkie::Api::Types::UserStatus::ACTIVE
end

#bank_accountsObject



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/tikkie/api/responses/user.rb', line 25

def bank_accounts
  @bank_accounts ||= begin
    bank_accounts = []

    data[:bankAccounts].each do |data|
      bank_accounts << Tikkie::Api::Responses::BankAccount.new(data)
    end

    bank_accounts
  end
end

#nameObject



12
13
14
# File 'lib/tikkie/api/responses/user.rb', line 12

def name
  data[:name]
end

#statusObject

see UserStatus



17
18
19
# File 'lib/tikkie/api/responses/user.rb', line 17

def status
  data[:status]
end

#user_tokenObject



8
9
10
# File 'lib/tikkie/api/responses/user.rb', line 8

def user_token
  data[:userToken]
end