Class: Pronto::BigFiles::PatchWrapper
- Inherits:
-
Object
- Object
- Pronto::BigFiles::PatchWrapper
- Defined in:
- lib/pronto/bigfiles/patch_wrapper.rb
Overview
Add convenience methods on top of Pronto::Git::Patch
Instance Attribute Summary collapse
-
#patch ⇒ Object
readonly
Returns the value of attribute patch.
Instance Method Summary collapse
- #added_to? ⇒ Boolean
- #first_added_line ⇒ Object
-
#initialize(patch) ⇒ PatchWrapper
constructor
A new instance of PatchWrapper.
- #path ⇒ Object
Constructor Details
#initialize(patch) ⇒ PatchWrapper
Returns a new instance of PatchWrapper.
11 12 13 |
# File 'lib/pronto/bigfiles/patch_wrapper.rb', line 11 def initialize(patch) @patch = patch end |
Instance Attribute Details
#patch ⇒ Object (readonly)
Returns the value of attribute patch.
9 10 11 |
# File 'lib/pronto/bigfiles/patch_wrapper.rb', line 9 def patch @patch end |
Instance Method Details
#added_to? ⇒ Boolean
15 16 17 |
# File 'lib/pronto/bigfiles/patch_wrapper.rb', line 15 def added_to? (patch.additions - patch.deletions).positive? end |
#first_added_line ⇒ Object
23 24 25 |
# File 'lib/pronto/bigfiles/patch_wrapper.rb', line 23 def first_added_line patch.added_lines.first end |
#path ⇒ Object
19 20 21 |
# File 'lib/pronto/bigfiles/patch_wrapper.rb', line 19 def path patch.delta.new_file[:path] end |