Class: TrelloBranch

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(board_id) ⇒ TrelloBranch

Returns a new instance of TrelloBranch.



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

def initialize(board_id)
  @board = Trello::Board.find(board_id)
  @logger = Logger.new(STDOUT)
end

Instance Attribute Details

#boardObject (readonly)

Returns the value of attribute board.



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

def board
  @board
end

#loggerObject (readonly)

Returns the value of attribute logger.



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

def logger
  @logger
end

Instance Method Details

#checkout_card(short_id) ⇒ Object



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

def checkout_card(short_id)
  logger.info "TrelloBranch: Looking up card ##{short_id}"
  c = card(short_id)
  branch_name = branch_name_for_card(c)

  logger.info "TrelloBranch: Checking out branch: #{branch_name}"
  checkout_branch(branch_name)
end