Class: Ecoportal::API::Internal::Person

Inherits:
V1::Person show all
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

Attributes inherited from V1::Person

#details, #external_id, #id, #name, #subordinates, #supervisor_id

Attributes inherited from Common::BaseModel

#_key, #_parent

Instance Method Summary collapse

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

#accountAccount?

the account of the person or nil if missing.

Returns:

  • (Account, nil)

    the current value of account



5
6
7
# File 'lib/ecoportal/api/internal/person.rb', line 5

def 
  @account
end

Instance Method Details

#add_accountObject

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 
  self. = {}
end

#as_jsonObject



10
11
12
# File 'lib/ecoportal/api/internal/person.rb', line 10

def as_json
  super.update("account" => &.as_json)
end