Class: Idler::Branch

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

Instance Method Summary collapse

Constructor Details

#initialize(branch_name = nil, block = nil) ⇒ Branch

Returns a new instance of Branch.



4
5
6
7
8
9
10
11
12
# File 'lib/idler/branch.rb', line 4

def initialize(branch_name = nil, block = nil)
  raise Idler::NotDetectBranchError if branch_name.nil?
  @branch = branch_name

  descriptions.add_branch branch_name
  workers.add_branch      branch_name

  self.instance_eval &block unless block.nil?
end

Instance Method Details

#desc(description) ⇒ Object



14
15
16
# File 'lib/idler/branch.rb', line 14

def desc(description)
  descriptions.add_desc @branch, description
end

#detail(note) ⇒ Object



18
19
20
# File 'lib/idler/branch.rb', line 18

def detail(note)
  descriptions.add_detail @branch, note
end

#worker(&block) ⇒ Object



22
23
24
# File 'lib/idler/branch.rb', line 22

def worker(&block)
  workers.add_worker @branch, block
end