Class: Veye::User::FavoritePretty

Inherits:
BasePretty show all
Defined in:
lib/veye/views/user/favorite_pretty.rb

Instance Method Summary collapse

Methods inherited from BasePretty

#after, #before

Instance Method Details

#format(results) ⇒ Object



6
7
8
9
10
# File 'lib/veye/views/user/favorite_pretty.rb', line 6

def format(results)
  return if results.nil?
  items = results['favorites']
  items.each_with_index {|fav, index| print_row(fav, index)}
end


11
12
13
14
15
16
17
18
19
20
# File 'lib/veye/views/user/favorite_pretty.rb', line 11

def print_row(fav, index)
  printf(
    "\t%15s - %s\n",
    "#{fav['name']}".color(:green).bright,
    "#{fav['prod_key'].bright}"
  )
  printf("\t%-15s: %s\n", "Product type", fav['prod_type'])
  printf("\t%-15s: %s\n", "Version", "#{fav['prod_type']}".bright)
  printf("\t%-15s: %s\n", "Language", fav['language'])
end