Class: GitDiff::File
- Inherits:
-
Object
- Object
- GitDiff::File
- Defined in:
- lib/git_diff/file.rb
Instance Attribute Summary collapse
-
#a_blob ⇒ Object
readonly
Returns the value of attribute a_blob.
-
#a_path ⇒ Object
readonly
Returns the value of attribute a_path.
-
#b_blob ⇒ Object
readonly
Returns the value of attribute b_blob.
-
#b_mode ⇒ Object
readonly
Returns the value of attribute b_mode.
-
#b_path ⇒ Object
readonly
Returns the value of attribute b_path.
-
#hunks ⇒ Object
readonly
Returns the value of attribute hunks.
Class Method Summary collapse
Instance Method Summary collapse
- #<<(string) ⇒ Object
-
#initialize ⇒ File
constructor
A new instance of File.
- #stats ⇒ Object
Constructor Details
#initialize ⇒ File
Returns a new instance of File.
12 13 14 |
# File 'lib/git_diff/file.rb', line 12 def initialize @hunks = [] end |
Instance Attribute Details
#a_blob ⇒ Object (readonly)
Returns the value of attribute a_blob.
4 5 6 |
# File 'lib/git_diff/file.rb', line 4 def a_blob @a_blob end |
#a_path ⇒ Object (readonly)
Returns the value of attribute a_path.
4 5 6 |
# File 'lib/git_diff/file.rb', line 4 def a_path @a_path end |
#b_blob ⇒ Object (readonly)
Returns the value of attribute b_blob.
4 5 6 |
# File 'lib/git_diff/file.rb', line 4 def b_blob @b_blob end |
#b_mode ⇒ Object (readonly)
Returns the value of attribute b_mode.
4 5 6 |
# File 'lib/git_diff/file.rb', line 4 def b_mode @b_mode end |
#b_path ⇒ Object (readonly)
Returns the value of attribute b_path.
4 5 6 |
# File 'lib/git_diff/file.rb', line 4 def b_path @b_path end |
#hunks ⇒ Object (readonly)
Returns the value of attribute hunks.
4 5 6 |
# File 'lib/git_diff/file.rb', line 4 def hunks @hunks end |
Class Method Details
Instance Method Details
#<<(string) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/git_diff/file.rb', line 16 def <<(string) return if (string) if(range_info = RangeInfo.from_string(string)) add_hunk Hunk.new(range_info) else append_to_current_hunk string end end |