# frozen_string_literal: true module Voucher class Segment include Virtus.model FIELDS = %w( advertiser_id agency_id app_id campaign_id channel_id clicks conversions decision_cost decision_win_impressions exchange_id impressions loaded_impressions publisher_id site_id win_cost ).sort.freeze attribute :advertiser_id, String attribute :agency_id, String attribute :app_id, String attribute :campaign_id, String attribute :channel_id, String attribute :clicks, Integer attribute :conversions, Integer attribute :decision_cost, Integer attribute :decision_win_impressions, Integer attribute :exchange_id, String attribute :impressions, Integer attribute :loaded_impressions, Integer attribute :publisher_id, String attribute :site_id, String attribute :win_cost, Integer attribute :shard, Integer attribute :siblings, Array[String] def hash Hashtastic::DictionaryValuesHasher.call(attributes, FIELDS) end end end