Class: LineDetector::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/line-detector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line_ending, final_eol) ⇒ Report

Returns a new instance of Report.



108
109
110
111
# File 'lib/line-detector.rb', line 108

def initialize(line_ending, final_eol)
  @line_ending = line_ending
  @final_eol = final_eol
end

Instance Attribute Details

#final_eolObject

Returns the value of attribute final_eol.



106
107
108
# File 'lib/line-detector.rb', line 106

def final_eol
  @final_eol
end

#line_endingObject

Returns the value of attribute line_ending.



106
107
108
# File 'lib/line-detector.rb', line 106

def line_ending
  @line_ending
end

Instance Method Details

#to_sObject



113
114
115
116
117
118
119
120
121
122
# File 'lib/line-detector.rb', line 113

def to_s
  final_eol_piece =
    if @final_eol
      ', with final eol'
    else
      ', without final eol'
    end

  "#{@line_ending.to_s}#{final_eol_piece}"
end