Class: GitDiff::Parser
- Inherits:
-
Object
- Object
- GitDiff::Parser
- Defined in:
- lib/git_diff/parser.rb
Instance Attribute Summary collapse
-
#diff ⇒ Object
readonly
Returns the value of attribute diff.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(string) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(string) ⇒ Parser
Returns a new instance of Parser.
5 6 7 8 |
# File 'lib/git_diff/parser.rb', line 5 def initialize(string) @string = string @diff = Diff.new end |
Instance Attribute Details
#diff ⇒ Object (readonly)
Returns the value of attribute diff.
3 4 5 |
# File 'lib/git_diff/parser.rb', line 3 def diff @diff end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
3 4 5 |
# File 'lib/git_diff/parser.rb', line 3 def string @string end |
Instance Method Details
#parse ⇒ Object
10 11 12 13 14 |
# File 'lib/git_diff/parser.rb', line 10 def parse lines.each do |line| diff << line end end |