Class: GitCommitNotifier::DiffCallback
- Inherits:
-
Object
- Object
- GitCommitNotifier::DiffCallback
- Defined in:
- lib/git_commit_notifier/diff_callback.rb
Overview
Callback for Diff::LCS.traverse_balanced method.
Instance Attribute Summary collapse
-
#tags ⇒ Array(Hash)
readonly
Gets collected tags.
Instance Method Summary collapse
-
#discard_a(event) ⇒ Object
Adds discarded A side to #tags.
-
#discard_b(event) ⇒ Object
Adds discarded B side to #tags.
-
#initialize ⇒ DiffCallback
constructor
A new instance of DiffCallback.
-
#match(event) ⇒ Object
Adds diff match to #tags.
Constructor Details
#initialize ⇒ DiffCallback
Returns a new instance of DiffCallback.
10 11 12 |
# File 'lib/git_commit_notifier/diff_callback.rb', line 10 def initialize @tags = [] end |
Instance Attribute Details
#tags ⇒ Array(Hash) (readonly)
Gets collected tags.
8 9 10 |
# File 'lib/git_commit_notifier/diff_callback.rb', line 8 def @tags end |
Instance Method Details
#discard_a(event) ⇒ Object
Adds discarded A side to #tags.
25 26 27 |
# File 'lib/git_commit_notifier/diff_callback.rb', line 25 def discard_a(event) @tags << { :action => :discard_a, :token => event.old_element } end |
#discard_b(event) ⇒ Object
Adds discarded B side to #tags.
20 21 22 |
# File 'lib/git_commit_notifier/diff_callback.rb', line 20 def discard_b(event) @tags << { :action => :discard_b, :token => event.new_element } end |
#match(event) ⇒ Object
Adds diff match to #tags.
15 16 17 |
# File 'lib/git_commit_notifier/diff_callback.rb', line 15 def match(event) @tags << { :action => :match, :token => event.old_element } end |