Sha256: ddeed308db875122b39ea34c8c44c1ac44b897b6f8ab98ea83251bfef31cbdf0

Contents?: true

Size: 921 Bytes

Versions: 5

Compression:

Stored size: 921 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
        class << self
          def redef_without_warning(const, value)
            self.class.send(:remove_const, const) if self.class.const_defined?(const)
            self.class.const_set(const, value)
          end
        end

        redef_without_warning('VALID_TAG_REGEX', /^[A-Za-z0-9 &_'\/.-]+$/)

        passthrough :contractor_organization_id

        attr_accessor :entry

        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

5 entries across 5 versions & 1 rubygems

Version Path
eco-helpers-2.2.5 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.2.4 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.2.3 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.2.2 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
eco-helpers-2.2.1 lib/eco/api/common/version_patches/ecoportal_api/external_person.rb