class TorrentSearch::Views::Menu
Public Class Methods
new(actions, search_result)
click to toggle source
# File lib/torrent_search/views/menu.rb, line 5 def initialize(actions, search_result) @actions = actions @search_result = search_result end
Public Instance Methods
display()
click to toggle source
# File lib/torrent_search/views/menu.rb, line 10 def display say_status "\n[Results]", '', :green if results? print_search_result_table else say 'Nothing found' end say_status "\n[Actions]", action_menu, :blue end
Private Instance Methods
print_search_result_table()
click to toggle source
# File lib/torrent_search/views/menu.rb, line 25 def print_search_result_table print_table ResultTable.new(@search_result) end
results?()
click to toggle source
# File lib/torrent_search/views/menu.rb, line 21 def results? @search_result.any? end