Class: GitLeadTime::Branch

Inherits:
Object
  • Object
show all
Defined in:
lib/git_lead_time/branch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ref) ⇒ Branch

Returns a new instance of Branch.



8
9
10
11
# File 'lib/git_lead_time/branch.rb', line 8

def initialize(ref)
  @ref = ref
  @merge_information = MergeInformation.new(ref)
end

Instance Attribute Details

#merge_informationObject (readonly)

Returns the value of attribute merge_information.



6
7
8
# File 'lib/git_lead_time/branch.rb', line 6

def merge_information
  @merge_information
end

#refObject (readonly)

Returns the value of attribute ref.



6
7
8
# File 'lib/git_lead_time/branch.rb', line 6

def ref
  @ref
end

Instance Method Details

#each_mergeObject



13
14
15
16
17
18
19
# File 'lib/git_lead_time/branch.rb', line 13

def each_merge
  return to_enum(__method__) unless block_given?

  MergeEnumerator.new(ref).each do |merge|
    yield merge_information.info_for(merge)
  end
end