Method: Bcome::RenderIrb#construct_menu_item_string

Defined in:
lib/render_irb.rb

#construct_menu_item_string(item, index, colour) ⇒ Object



38
39
40
41
42
43
44
45
46
47
# File 'lib/render_irb.rb', line 38

def construct_menu_item_string(item, index, colour)
  command = item[:command]
  description = item[:description]
  usage = item[:usage]
  menu_str = "#{tab}#{index+1}. #{description}".send(colour) + "\n"
  menu_str += "#{tab}" + "Command: ".menu_item_cyan + "#{command}\n".menu_item_white
  menu_str += "#{tab}" + "Usage: ".menu_item_cyan + "#{usage}\n".menu_item_white if usage
  menu_str += "\n"
  return menu_str
end