module BilisimSozlugu
typed: strict
Constants
- CSS_SELECTOR
- URL
- VERSION
Public Class Methods
search(word)
click to toggle source
# File lib/bilisim_sozlugu.rb, line 17 def self.search(word) call_url = T.let(URL + word, String) page = Nokogiri::HTML(open(call_url)) rows = page.css(CSS_SELECTOR) if rows.last.text.match("Aranan Kelime") puts "Aradığınız kelime bulunamadı." else words = rows.map { |row| [row.children.first.children.text, row.children.last.text] } table = Terminal::Table.new :rows => words.drop(2) puts table end end