Sha256: 0e312cd71c376d8f548cb607c15d9c1e7f5ed62f01bee3483ee03d8c7f8d494d

Contents?: true

Size: 717 Bytes

Versions: 9

Compression:

Stored size: 717 Bytes

Contents

# Copyright (c) 2010-2021 Minero Aoki, Kenshi Muto
#
# This program is free software.
# You can distribute or modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
# For details of the GNU LGPL, see the file "COPYING".
#

module ReVIEW
  class Preprocessor
    class Line
      def initialize(number, string)
        @number = number
        @string = string
      end

      attr_reader :number
      attr_reader :string
      alias_method :to_s, :string

      def edit
        self.class.new(@number, yield(@string))
      end

      def empty?
        @string.strip.empty?
      end

      def num_indent
        @string.slice(/\A\s*/).size
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
review-5.10.0 lib/review/preprocessor/line.rb
review-5.9.0 lib/review/preprocessor/line.rb
review-5.8.0 lib/review/preprocessor/line.rb
review-5.7.0 lib/review/preprocessor/line.rb
review-5.6.0 lib/review/preprocessor/line.rb
review-5.5.0 lib/review/preprocessor/line.rb
review-5.4.0 lib/review/preprocessor/line.rb
review-5.3.0 lib/review/preprocessor/line.rb
review-5.2.0 lib/review/preprocessor/line.rb