Class: Tikkie::Api::Responses::User
- Defined in:
- lib/tikkie/api/responses/user.rb
Overview
Response when requesting an user.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #active? ⇒ Boolean
- #bank_accounts ⇒ Object
- #name ⇒ Object
-
#status ⇒ Object
see UserStatus.
- #user_token ⇒ Object
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
21 22 23 |
# File 'lib/tikkie/api/responses/user.rb', line 21 def active? status == Tikkie::Api::Types::UserStatus::ACTIVE end |
#bank_accounts ⇒ Object
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 |
#name ⇒ Object
12 13 14 |
# File 'lib/tikkie/api/responses/user.rb', line 12 def name data[:name] end |
#status ⇒ Object
see UserStatus
17 18 19 |
# File 'lib/tikkie/api/responses/user.rb', line 17 def status data[:status] end |
#user_token ⇒ Object
8 9 10 |
# File 'lib/tikkie/api/responses/user.rb', line 8 def user_token data[:userToken] end |