Class: Ecoportal::API::Internal::Person
- Inherits:
-
V1::Person
- Object
- Common::BaseModel
- V1::Person
- Ecoportal::API::Internal::Person
- Defined in:
- lib/ecoportal/api/internal/person.rb
Constant Summary
Constants inherited from V1::Person
V1::Person::VALID_EMAIL_REGEX, V1::Person::VALID_TAG_REGEX
Instance Attribute Summary collapse
-
#account ⇒ Account?
the account of the person or
nilif missing.
Attributes inherited from V1::Person
#details, #external_id, #id, #name, #subordinates, #supervisor_id
Attributes inherited from Common::BaseModel
Instance Method Summary collapse
-
#add_account ⇒ Object
Adds an empty account to the person.
- #as_json ⇒ Object
Methods inherited from V1::Person
#add_details, #email=, #filter_tags, #filter_tags=, #supervisor, #supervisor=
Methods inherited from Common::BaseModel
#as_update, #consolidate!, #dirty?, #doc, embeds_one, #initial_doc, #initialize, #original_doc, passthrough, #print_pretty, #reset!, #to_json
Methods included from Common::BaseClass
#class_resolver, #resolve_class
Constructor Details
This class inherits a constructor from Ecoportal::API::Common::BaseModel
Instance Attribute Details
#account ⇒ Account?
the account of the person or nil if missing.
5 6 7 |
# File 'lib/ecoportal/api/internal/person.rb', line 5 def account @account end |
Instance Method Details
#add_account ⇒ Object
Note:
if the person exists, and does not have an account, an this will send an invite.
Note:
this will not change the account properties of this person.
Adds an empty account to the person.
40 41 42 |
# File 'lib/ecoportal/api/internal/person.rb', line 40 def add_account self.account = {} end |
#as_json ⇒ Object
10 11 12 |
# File 'lib/ecoportal/api/internal/person.rb', line 10 def as_json super.update("account" => account&.as_json) end |