def filter(*line_items)
      result = {}
      params = { line_item_ids: line_items.join(','), with_deleted: true }
      @account.line_items(nil, params).each do |line_item|
        # filter by objective
        objective = line_item.objective.downcase.to_sym
        metrics   = OBJECTIVES[objective].map { |family| METRIC_FAMILIES[family] }.flatten

        # filter by placements
        placements = line_item.placements.map { |p| p.downcase.to_sym }
        filter_placements(metrics, placements)

        # filter by product
        product = line_item.product_type.downcase.to_sym
        filter_product(metrics, product)

        # filter LTV metrics unless account has a MACT partner setup
        metrics.reject! { |m| m.include?('mobile_lifetime_value_') } unless @mact_enabled

        result[line_item.id] = metrics
      end
      result
    end
def filter(*line_items)
      result = {}
      params = { line_item_ids: line_items.join(','), with_deleted: true }
      @account.line_items(nil, params).each do |line_item|
        # filter by objective
        objective = line_item.objective.downcase.to_sym
        metrics   = OBJECTIVES[objective].map { |family| METRIC_FAMILIES[family] }.flatten

        # filter by placements
        placements = line_item.placements.map { |p| p.downcase.to_sym }
        filter_placements(metrics, placements)

        # filter by product
        product = line_item.product_type.downcase.to_sym
        filter_product(metrics, product)

        # filter LTV metrics unless account has a MACT partner setup
        metrics.reject! { |m| m.include?('mobile_lifetime_value_') } unless @mact_enabled

        result[line_item.id] = metrics
      end
      result
    end
Sets up the object with the correct account and client information.

 @example
   metric_filter = TwitterAds::Metric.new('xyz1')

 @param account_id [String] The ID for the account to be used.
 @param client [Client] Optional client instance to be used. Will default to ~/.twurlrc info.
 @param mact_enabled [Boolean] Indicates the account has a MACT partner setup (default: false).

 @return [self] The configured object instance.
 Determines relevant metrics from a list of line item IDs.

 @example
   metric_filter.filter(line_item_ids)

 @param line_items [String/Array] A list of one or more line item IDs.

 @return [Hash] A hash with relevant metrics for each line item.