module Ecoportal module API class Internal class Person def new?(doc = :initial) ref_doc = (doc == :original) ? original_doc : initial_doc !ref_doc["details"] && !ref_doc["account"] end # @return [Boolean] if the account has been added, compared to `doc` def account_added?(doc = :initial) ref_doc = (doc == :original) ? original_doc : initial_doc account && !ref_doc["account"] end end end end end