Class: Git::GitBranch
- Inherits:
-
Object
- Object
- Git::GitBranch
- Defined in:
- lib/git/git_branch.rb
Instance Attribute Summary collapse
-
#author_email ⇒ Object
readonly
Returns the value of attribute author_email.
-
#author_name ⇒ Object
readonly
Returns the value of attribute author_name.
-
#last_modified_date ⇒ Object
readonly
Returns the value of attribute last_modified_date.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#repository_name ⇒ Object
readonly
Returns the value of attribute repository_name.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #=~(other) ⇒ Object
-
#initialize(repository_name, name, last_modified_date, author_name, author_email) ⇒ GitBranch
constructor
A new instance of GitBranch.
- #to_s ⇒ Object
Constructor Details
#initialize(repository_name, name, last_modified_date, author_name, author_email) ⇒ GitBranch
Returns a new instance of GitBranch.
7 8 9 10 11 12 13 |
# File 'lib/git/git_branch.rb', line 7 def initialize(repository_name, name, last_modified_date, , ) @repository_name = repository_name @name = name @last_modified_date = last_modified_date = = end |
Instance Attribute Details
#author_email ⇒ Object (readonly)
Returns the value of attribute author_email.
5 6 7 |
# File 'lib/git/git_branch.rb', line 5 def end |
#author_name ⇒ Object (readonly)
Returns the value of attribute author_name.
5 6 7 |
# File 'lib/git/git_branch.rb', line 5 def end |
#last_modified_date ⇒ Object (readonly)
Returns the value of attribute last_modified_date.
5 6 7 |
# File 'lib/git/git_branch.rb', line 5 def last_modified_date @last_modified_date end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/git/git_branch.rb', line 5 def name @name end |
#repository_name ⇒ Object (readonly)
Returns the value of attribute repository_name.
5 6 7 |
# File 'lib/git/git_branch.rb', line 5 def repository_name @repository_name end |
Class Method Details
.name_from_ref(ref) ⇒ Object
31 32 33 |
# File 'lib/git/git_branch.rb', line 31 def self.name_from_ref(ref) ref.gsub(/^refs\/heads\//, '') end |
Instance Method Details
#==(other) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/git/git_branch.rb', line 23 def ==(other) repository_name == other.repository_name \ && name == other.name && \ last_modified_date == other.last_modified_date \ && == other. \ && == other. end |
#=~(other) ⇒ Object
19 20 21 |
# File 'lib/git/git_branch.rb', line 19 def =~(other) name =~ other end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/git/git_branch.rb', line 15 def to_s name end |