Class: GitDiffParser::Line
- Inherits:
-
Object
- Object
- GitDiffParser::Line
- Defined in:
- lib/git_diff_parser/line.rb
Overview
Parsed line
Instance Attribute Summary collapse
-
#content ⇒ String
readonly
Content.
-
#number ⇒ Integer
readonly
Line number.
-
#patch_position ⇒ Integer
readonly
Line patch position.
Instance Method Summary collapse
-
#changed? ⇒ Boolean
True if line changed.
-
#initialize(params) ⇒ Line
constructor
A new instance of Line.
Constructor Details
#initialize(params) ⇒ Line
Returns a new instance of Line.
16 17 18 19 20 21 22 23 |
# File 'lib/git_diff_parser/line.rb', line 16 def initialize(params) raise(ArgumentError('number is required')) unless params[:number] raise(ArgumentError('content is required')) unless params[:content] raise(ArgumentError('patch_position is required')) unless params[:patch_position] @number = params[:number] @content = params[:content] @patch_position = params[:patch_position] end |
Instance Attribute Details
#content ⇒ String (readonly)
Returns content.
5 6 7 |
# File 'lib/git_diff_parser/line.rb', line 5 def content @content end |
#number ⇒ Integer (readonly)
Returns line number.
5 6 7 |
# File 'lib/git_diff_parser/line.rb', line 5 def number @number end |
#patch_position ⇒ Integer (readonly)
Returns line patch position.
5 6 7 |
# File 'lib/git_diff_parser/line.rb', line 5 def patch_position @patch_position end |
Instance Method Details
#changed? ⇒ Boolean
Returns true if line changed.
26 27 28 |
# File 'lib/git_diff_parser/line.rb', line 26 def changed? true end |