Class: Vim::Flavor::BranchVersion
- Inherits:
-
Object
- Object
- Vim::Flavor::BranchVersion
- Defined in:
- lib/vim-flavor/branchversion.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(branch, revision) ⇒ BranchVersion
constructor
A new instance of BranchVersion.
- #to_revision ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(branch, revision) ⇒ BranchVersion
Returns a new instance of BranchVersion.
7 8 9 10 |
# File 'lib/vim-flavor/branchversion.rb', line 7 def initialize(branch, revision) @branch = branch @revision = revision end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
4 5 6 |
# File 'lib/vim-flavor/branchversion.rb', line 4 def branch @branch end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
5 6 7 |
# File 'lib/vim-flavor/branchversion.rb', line 5 def revision @revision end |
Instance Method Details
#==(other) ⇒ Object
12 13 14 15 16 |
# File 'lib/vim-flavor/branchversion.rb', line 12 def ==(other) self.class === other and self.branch == other.branch and self.revision == other.revision end |
#to_revision ⇒ Object
22 23 24 25 |
# File 'lib/vim-flavor/branchversion.rb', line 22 def to_revision() return revision if revision throw "Internal error: A revision of a branch #{branch} is not known" end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/vim-flavor/branchversion.rb', line 18 def to_s() "#{revision} at #{branch}" end |