Class: Vim::Flavor::BranchVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/vim-flavor/branchversion.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#branchObject (readonly)

Returns the value of attribute branch.



4
5
6
# File 'lib/vim-flavor/branchversion.rb', line 4

def branch
  @branch
end

#revisionObject (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_revisionObject



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_sObject



18
19
20
# File 'lib/vim-flavor/branchversion.rb', line 18

def to_s()
  "#{revision} at #{branch}"
end