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