Class: Gugl::Search::Displayers::TerminalResultDisplayer

Inherits:
Object
  • Object
show all
Includes:
Term::ANSIColor
Defined in:
lib/search/displayers/terminal_result_displayer.rb

Constant Summary collapse

ENDING_LINES =
50

Instance Method Summary collapse

Instance Method Details

#display(result, index) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/search/displayers/terminal_result_displayer.rb', line 11

def display(result, index)
  # title
  print magenta, index.next, ".", result.title, reset, "\n\n"
  # snippet
  print white, result.snippet, "\n\n", reset
  # link
  print white, "Link: ", blue, result.link, reset, "\n\n"
    
  print ("-" * ENDING_LINES), "\n\n"
end