lib/column.rb in trollolo-0.1.1 vs lib/column.rb in trollolo-0.2.0
- old
+ new
@@ -13,25 +13,26 @@
# along with this program; if not, contact SUSE LLC.
#
# To contact SUSE about this file by physical or electronic mail,
# you may find current contact information at www.suse.com
class Column
- def initialize(board_data, list_id)
+ def initialize(board_data, list_id, settings = nil)
@board_data = board_data
- @list_data = @board_data["lists"].find{|l| l["id"] == list_id}
+ @settings = settings
+ @list_data = @board_data['lists'].find{|l| l['id'] == list_id}
end
def name
- @list_data["name"]
+ @list_data['name']
end
def estimated_cards
- cards.select{|x| x.estimated? }
+ cards.select(&:estimated?)
end
def sum
- estimated_cards.map{|x| x.story_points}.sum
+ estimated_cards.map(&:story_points).sum
end
def tasks
cards.map(&:tasks).sum
end
@@ -39,27 +40,27 @@
def done_tasks
cards.map(&:done_tasks).sum
end
def extra_cards
- cards.select{|c| c.extra?}
+ cards.select(&:extra?)
end
def unplanned_cards
- cards.select{|c| c.unplanned?}
+ cards.select(&:unplanned?)
end
def committed_cards
cards.select{|c| !c.extra? && !c.unplanned?}
end
def fast_lane_cards
- cards.select{|c| c.fast_lane?}
+ cards.select(&:fast_lane?)
end
def cards
return @cards if @cards
- cards = @board_data["cards"].select{|c| c["idList"] == @list_data["id"]}
- @cards = cards.map{|c| Card.new(@board_data, c["id"])}
+ cards = @board_data['cards'].select{|c| c['idList'] == @list_data['id']}
+ @cards = cards.map{|c| Card.new(@board_data, c['id'], @settings)}
end
end