source/kata.rb
1# Rules about one practice session.
2module Kata
3 # True for a six-character id.
def self.id?(id) = id.is_a?(String) && id.size == 6
&&311
├─ id.is_a?(String)TTF
└─ id.size == 6TF
5
6 # True for a kata started and not yet finished.
7 def self.runnable?(kata)
kata.started && !kata.finished
&&011
├─ kata.startedTTF
└─ !kata.finishedFT
10 end
11
12 # [both ids valid, the two ids different].
13 def self.pair_checks(one, other)
[id?(one) && id?(other), one != other && other != '']
&&001
├─ id?(one)TFT
└─ id?(other)FT
&&001
├─ one != otherTTF
└─ other != ''TF
15 end
16end