Class: Veksel::Suffix

Inherits:
Object
  • Object
show all
Defined in:
lib/veksel/suffix.rb

Constant Summary collapse

PROTECTED_BRANCHES =
%w[master main].freeze

Instance Method Summary collapse

Constructor Details

#initialize(branch_name) ⇒ Suffix

Returns a new instance of Suffix.



5
6
7
# File 'lib/veksel/suffix.rb', line 5

def initialize(branch_name)
  @branch_name = branch_name
end

Instance Method Details

#to_sObject



9
10
11
12
13
14
15
16
17
# File 'lib/veksel/suffix.rb', line 9

def to_s
  case @branch_name
  when 'HEAD'
  when *PROTECTED_BRANCHES
    ""
  else
    @branch_name
  end
end