Class: Eco::API::Common::People::PersonModifier
Constant Summary
collapse
- WITH_DETAILS =
%i[contact details with_details schema with_schema].freeze
- NO_DETAILS =
%i[no_details only_account].freeze
- WITH_ACCOUNT =
%i[user account with_account].freeze
- NO_ACCOUNT =
%i[no_account only_details].freeze
- INTERNAL_PERSON =
%i[internal v0].freeze
- EXTERNAL_PERSON =
%i[external v1].freeze
Language::Models::Modifier::DEFAULT_MODE
Instance Method Summary
collapse
#<, #<<, #default, #default?, #flush_mode, #initialize, #mode, #new, #reset
Instance Method Details
#add_account? ⇒ Boolean
23
24
25
|
# File 'lib/eco/api/common/people/person_modifier.rb', line 23
def add_account?
mode.any? { |m| WITH_ACCOUNT.include?(m) }
end
|
#add_details? ⇒ Boolean
31
32
33
|
# File 'lib/eco/api/common/people/person_modifier.rb', line 31
def add_details?
mode.any? { |m| WITH_DETAILS.include?(m) }
end
|
#external? ⇒ Boolean
44
45
46
|
# File 'lib/eco/api/common/people/person_modifier.rb', line 44
def external?
mode.any? { |m| EXTERNAL_PERSON.include?(m) }
end
|
#internal? ⇒ Boolean
39
40
41
42
|
# File 'lib/eco/api/common/people/person_modifier.rb', line 39
def internal?
bool = mode.any? { |m| INTERNAL_PERSON.include?(m) }
bool || !external?
end
|
#no_account? ⇒ Boolean
27
28
29
|
# File 'lib/eco/api/common/people/person_modifier.rb', line 27
def no_account?
mode.any? { |m| NO_ACCOUNT.include?(m) }
end
|
#no_details ⇒ Object
19
20
21
|
# File 'lib/eco/api/common/people/person_modifier.rb', line 19
def no_details
push(:no_details)
end
|
#no_details? ⇒ Boolean
35
36
37
|
# File 'lib/eco/api/common/people/person_modifier.rb', line 35
def no_details?
mode.any? { |m| NO_DETAILS.include?(m) }
end
|
#reset_add_account ⇒ Object
15
16
17
|
# File 'lib/eco/api/common/people/person_modifier.rb', line 15
def reset_add_account
self < mode - (WITH_ACCOUNT | NO_ACCOUNT)
end
|