Class: Blastr::SourceControl::MercurialRevision

Inherits:
Object
  • Object
show all
Defined in:
lib/scm/hg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ MercurialRevision

Returns a new instance of MercurialRevision.



10
11
12
# File 'lib/scm/hg.rb', line 10

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/scm/hg.rb', line 8

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



18
19
20
# File 'lib/scm/hg.rb', line 18

def ==(other)
  @name == other.name
end

#before?(revision) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
25
26
# File 'lib/scm/hg.rb', line 22

def before?(revision)
  return false if @name == "tip"
  return true if revision.name == "tip"
  @name.to_i < revision.name.to_i
end

#to_sObject



14
15
16
# File 'lib/scm/hg.rb', line 14

def to_s
  @name
end