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

Inherits:
Base
  • Object
show all
Defined in:
lib/tikkie/api/v1/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::V1::Responses::Base

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


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

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

#bank_accountsObject



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

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

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

    bank_accounts
  end
end

#nameObject



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

def name
  data[:name]
end

#statusObject

see UserStatus



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

def status
  data[:status]
end

#user_tokenObject



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

def user_token
  data[:userToken]
end