openSUSE/trollolo

View on GitHub
lib/scrum/card_type_detection.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Scrum
  module CardTypeDetection
    def sticky?(card)
      card.labels.any? { |l| l.name == @settings.label_names['sticky'] }
    end

    def waterline?(card)
      card.name =~ /w.?a.?t.?e.?r.?l.?i.?n.?e/i
    end

    def seabed?(card)
      card.name =~ /s.?e.?a.?b.?e.?d/i
    end

    def waterline_card
      @backlog_list.cards.find { |card| waterline?(card) }
    end

    def seabed_card
      @backlog_list.cards.find { |card| seabed?(card) }
    end
  end
end