Sha256: b79b93b6ceaf4882237d834d22554d0f44f7ea443be82ee8de895f8cbe6d4725

Contents?: true

Size: 734 Bytes

Versions: 7

Compression:

Stored size: 734 Bytes

Contents

module Ecoportal
  module API
    class V1
      # @attr entry [Eco::API::Common::People::PersonEntry, Hash] the input entry plain hash data used to update/create this person.
      class Person
        attr_accessor :entry

        def reset_details!
          doc["details"] = JSON.parse(original_doc["details"])
        end

        def consolidate_details!
          original_doc["details"] = JSON.parse(doc["details"])
        end

        def identify
          if entry
            entry.to_s(:identify)
          else
            str_id = id ? "id: '#{id}'; " : ""
            "#{name}' (#{str_id}ext_id: '#{external_id}'; email: '#{email}')"
          end
        end

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
eco-helpers-2.0.7 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.6 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.5 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.4 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.3 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.2 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-1.5.15 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb