module Koshibukuro
  module Searcher
    class Result
      attr_reader :raw_result, :records, :limit, :offset, :total

      def initialize(raw_result: nil, records: nil, limit: nil, offset: nil, total: nil)
        @raw_result = raw_result
        @records = records
        @limit = limit
        @offset = offset
        @total = total
      end

      def to_ids
        @records.map(&:id)
      end

      def to_params
        @records.map(&:to_param)
      end
    end
  end
end
