This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "HTTParty" | |
require 'nokogiri' | |
module Instructions | |
def introductions | |
puts 'Welcome to dev.to webscraper. This CLi tool gathered articles based on the hashtag provided' | |
puts 'If you want to quit, simple type (q) the next time you are prompted to enter a value' | |
puts 'Please provide a hashtag to continue..' | |
puts '' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def first_non_repeating_letter(s) | |
return '' if s.strip == '' | |
non_rep_l = s.chars.uniq { |s| [s.downcase, s.upcase] }.select { |ss| s.downcase.count(ss.downcase) == 1 }.first | |
non_rep_l.nil? ? '' : non_rep_l | |
end |