Sha256: 9f90d9423f5d2a6eed816e205020b044a9d9958d2aba5d6403473a7f9fec4b79

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

# 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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
voucher-0.1.1 lib/voucher/model/segment.rb
voucher-0.1.0 lib/voucher/model/segment.rb