Sha256: 8d5aa6f976a5681c7051dabca96a9929ae0114c4c6a0f733ca0958ca8636fed6

Contents?: true

Size: 774 Bytes

Versions: 11

Compression:

Stored size: 774 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(section = :person)
          if entry && section == :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

11 entries across 11 versions & 1 rubygems

Version Path
eco-helpers-2.0.18 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.17 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.16 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.15 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.14 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.13 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.12 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.11 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.10 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.9 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.0.8 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb