class FinishCheck
Constants
- STEPS
Public Class Methods
new()
click to toggle source
# File lib/shunkuntype/finished_check.rb, line 25 def initialize finish = [[],[]] File.open(Shunkuntype::TRAIN_FILE,'r').each{|line| name = line.chomp.split(',')[1] step = name.scan(/\d+/)[0].to_i finish[0] << step } # text=[['Basic','minute'],['GerardStrong','size']] text=[['Basic','minute']] 1.times{|i| print display(STEPS[i],finish[i],text[i][0],text[i][1]) } end
Public Instance Methods
display(step,finished,title="***",command="***")
click to toggle source
# File lib/shunkuntype/finished_check.rb, line 40 def display(step,finished,title="***",command="***") cont = "You've finished #{title} drills of...\n" cont << sprintf("hour | %-21s | step\n",'contents') step.each_with_index do |ele,indx| cont << sprintf("%4s | %-21s | ",indx,ele[0]) ele[1..-1].each {|e2| cont << e2.to_s+"," if finished.include?(e2) } cont<< "\n" end next_step=finished[-1].to_i+1 cont << "To continue one minute training: shunkuntype -d #{next_step}.\n\n" return cont end