Sha256: fb2d45c282388b1c11d2a1f5643a803d7daad5fe9bbbd94df23adca7d1e57da5
Contents?: true
Size: 746 Bytes
Versions: 23
Compression:
Stored size: 746 Bytes
Contents
module Eco module API class MicroCases # @note by default `supervisor_id` is always excluded. # @param person [Ecoportal::API::V1::Person] the person we want to update, carrying the changes to be done. # @param options [Hash] the options. # @return [Array<String>] the core parameters that should not be included. def core_excluded(person, options) ["supervisor_id"].tap do |core_excluded| can_exclude = person.new?? ["filter_tags"] : %w[name external_id email filter_tags] exclusions = can_exclude.select do |attr| options.dig(:exclude, attr.to_sym) end core_excluded.concat(exclusions) end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems