module Coauthor::Prompt

Public Class Methods

fetch_user_info(user_count: 1) click to toggle source
# File lib/coauthor/prompt.rb, line 15
def fetch_user_info(user_count: 1)
  [].tap do |credentials|
    user_count.times do
      detail = {}
      detail['name'] = user_name
      detail['email'] = user_email
      credentials << detail if detail.keys.any? && !detail.values.join.strip.empty?
    end
  end
end
user_email() click to toggle source
# File lib/coauthor/prompt.rb, line 9
def user_email
  puts "Enter the author's email:".colorize(:yellow)
  STDIN.gets.chomp
end
user_name() click to toggle source
# File lib/coauthor/prompt.rb, line 3
def user_name
  puts "Enter the user's name:".colorize(:yellow)
  STDIN.gets.chomp
end

Private Instance Methods

fetch_user_info(user_count: 1) click to toggle source
# File lib/coauthor/prompt.rb, line 15
def fetch_user_info(user_count: 1)
  [].tap do |credentials|
    user_count.times do
      detail = {}
      detail['name'] = user_name
      detail['email'] = user_email
      credentials << detail if detail.keys.any? && !detail.values.join.strip.empty?
    end
  end
end
user_email() click to toggle source
# File lib/coauthor/prompt.rb, line 9
def user_email
  puts "Enter the author's email:".colorize(:yellow)
  STDIN.gets.chomp
end
user_name() click to toggle source
# File lib/coauthor/prompt.rb, line 3
def user_name
  puts "Enter the user's name:".colorize(:yellow)
  STDIN.gets.chomp
end