Sha256: af1e4e3d619a32a2b83f8a9f2e116996cbdec5239239fac32c8885442d06bd6a

Contents?: true

Size: 416 Bytes

Versions: 4

Compression:

Stored size: 416 Bytes

Contents

# frozen_string_literal: true
#
class Tryouts
  class Section < Array
    attr_accessor :path, :first, :last

    def initialize(path, start = 0)
      @path = path
      @first = start
      @last = start
    end

    def range
      @first..@last
    end

    def inspect
      range.to_a.zip(self).collect do |line|
        "%-4d %s\n" % line
      end.join
    end

    def to_s
      join($/)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tryouts-2.4.1 lib/tryouts/section.rb
tryouts-2.4.0 lib/tryouts/section.rb
tryouts-2.3.2 lib/tryouts/section.rb
tryouts-2.3.1 lib/tryouts/section.rb