Class: Tikkie::Api::V1::Responses::User
- Defined in:
- lib/tikkie/api/v1/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::V1::Responses::Base
Instance Method Details
#active? ⇒ 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_accounts ⇒ Object
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 |
#name ⇒ Object
13 14 15 |
# File 'lib/tikkie/api/v1/responses/user.rb', line 13 def name data[:name] end |
#status ⇒ Object
see UserStatus
18 19 20 |
# File 'lib/tikkie/api/v1/responses/user.rb', line 18 def status data[:status] end |
#user_token ⇒ Object
9 10 11 |
# File 'lib/tikkie/api/v1/responses/user.rb', line 9 def user_token data[:userToken] end |