lib/card.rb in trollolo-0.2.0 vs lib/card.rb in trollolo-0.3.0

- old
+ new

@@ -50,14 +50,21 @@ def tasks filtered_checklists.map(&:tasks).sum end def card_labels - @card_data['labels'] + @card_data['labels'] || [] end + def label?(label_name) + card_labels.any? do |label| + label['name'].include?(label_name) + end + end + def checklists + return [] unless @card_data['checklists'] @card_data['checklists'].map do |checklist| Checklist.new(checklist) end end @@ -80,9 +87,18 @@ def unplanned? card_labels.any? do |label| label['name'].include?('Unplanned') end + end + + def swimlane? + card_labels.each do |label| + @settings.swimlanes.each do |swimlane| + return true if label['name'].include?(swimlane) + end + end + false end def meta_card? name =~ SPRINT_NUMBER_REGEX end