Class: Git::GitConflict
- Inherits:
-
Object
- Object
- Git::GitConflict
- Defined in:
- lib/git/git_conflict.rb
Instance Attribute Summary collapse
-
#branch_a ⇒ Object
readonly
Returns the value of attribute branch_a.
-
#branch_b ⇒ Object
readonly
Returns the value of attribute branch_b.
-
#conflicting_files ⇒ Object
readonly
Returns the value of attribute conflicting_files.
-
#repository_name ⇒ Object
readonly
Returns the value of attribute repository_name.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #contains_branch(branch_name) ⇒ Object
-
#initialize(repository_name, branch_a, branch_b, conflicting_files) ⇒ GitConflict
constructor
A new instance of GitConflict.
Constructor Details
#initialize(repository_name, branch_a, branch_b, conflicting_files) ⇒ GitConflict
Returns a new instance of GitConflict.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/git/git_conflict.rb', line 7 def initialize(repository_name, branch_a, branch_b, conflicting_files) unless conflicting_files.present? raise ArgumentError, 'Must specify conflicting file list' end @repository_name = repository_name @branch_a = branch_a @branch_b = branch_b @conflicting_files = conflicting_files end |
Instance Attribute Details
#branch_a ⇒ Object (readonly)
Returns the value of attribute branch_a.
5 6 7 |
# File 'lib/git/git_conflict.rb', line 5 def branch_a @branch_a end |
#branch_b ⇒ Object (readonly)
Returns the value of attribute branch_b.
5 6 7 |
# File 'lib/git/git_conflict.rb', line 5 def branch_b @branch_b end |
#conflicting_files ⇒ Object (readonly)
Returns the value of attribute conflicting_files.
5 6 7 |
# File 'lib/git/git_conflict.rb', line 5 def conflicting_files @conflicting_files end |
#repository_name ⇒ Object (readonly)
Returns the value of attribute repository_name.
5 6 7 |
# File 'lib/git/git_conflict.rb', line 5 def repository_name @repository_name end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/git/git_conflict.rb', line 18 def ==(other) repository_name == other.repository_name \ && branch_a == other.branch_a \ && branch_b == other.branch_b \ && conflicting_files == other.conflicting_files end |
#contains_branch(branch_name) ⇒ Object
25 26 27 |
# File 'lib/git/git_conflict.rb', line 25 def contains_branch(branch_name) branch_a == branch_name || branch_b == branch_name end |