class PairUp::UI
Public Class Methods
prompt_for_pair(new_participant)
click to toggle source
# File lib/pair-up/ui.rb, line 6 def self.prompt_for_pair(new_participant) highline.say("I don't know who #{new_participant} is.") if highline.agree("Do you want to add #{new_participant} to ~/.pair-up_pairs? (yn)") participant_name = highline.ask("What is #{new_participant}'s full name?").to_s participant_email = highline.ask("What is #{new_participant}'s email?").to_s PairUp::Participant.add(new_participant, participant_email, participant_name) PairUp::Participant.write_file return new_participant else highline.say("Ignoring #{new_participant}.") end return nil end
Private Class Methods
highline()
click to toggle source
# File lib/pair-up/ui.rb, line 22 def self.highline @highline ||= HighLine.new end