module TokyoMetro::Factory::Seed::Common::Interruption

Public Class Methods

start!() click to toggle source
# File lib/tokyo_metro/factory/seed/common/interruption.rb, line 3
def self.start!
  puts ""
  puts "Complete! Do you want to continue? \[yn\]"
  go_to_next_process
end

Private Class Methods

get_yn() click to toggle source
# File lib/tokyo_metro/factory/seed/common/interruption.rb, line 26
def get_yn
  yn = ::STDIN.gets.chomp.downcase
  case yn
  when "y" , "n"
    return yn
  else
    puts "Please input \'y\' or \'n\'."
    self.send( __method__ )
  end
end
go_to_next_process() click to toggle source
# File lib/tokyo_metro/factory/seed/common/interruption.rb, line 13
def go_to_next_process
  yn = get_yn
  case yn
  when "y"
    puts "Go to next process!"
    puts ""
  when "n"
    puts "Please input \'y\' if you want to go to next process."
    puts ""
    self.send( __method__ )
  end
end