Sha256: 683476676fca931314cd233fdc6633b9d0fa643abced00b4cf579a0ef102c40d

Contents?: true

Size: 662 Bytes

Versions: 2

Compression:

Stored size: 662 Bytes

Contents

module Rankum
  module Readers
    class RankFileReader

      def initialize
        @perfect_rank = []
        @actual_rank = []
      end

      def add_perfect_rank_path path
        @perfect_rank = [] unless @perfect_rank.empty?
        @perfect_rank = to_array(path)
      end

      def add_actual_rank_path path
        @actual_rank = [] unless @actual_rank.empty?
        @actual_rank = to_array(path)
      end

      def perfect_rank
        @perfect_rank
      end

      def actual_rank
        @actual_rank
      end

      private
      def to_array rank_path
         IO.readlines(rank_path).map { |item| item.strip}
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rankum-1.1.0 lib/rankum/readers/rank_file_reader.rb
rankum-1.0.0 lib/rankum/readers/rank_file_reader.rb