Class: Veye::User::FavoriteTable
- Defined in:
- lib/veye/views/user/favorite_table.rb
Instance Method Summary collapse
- #format(results) ⇒ Object
-
#initialize ⇒ FavoriteTable
constructor
A new instance of FavoriteTable.
- #make_row(fav, index) ⇒ Object
Methods inherited from BaseTable
Constructor Details
#initialize ⇒ FavoriteTable
Returns a new instance of FavoriteTable.
6 7 8 9 |
# File 'lib/veye/views/user/favorite_table.rb', line 6 def initialize headings = %w(nr name product_key version language) super("Favorite packages", headings) end |
Instance Method Details
#format(results) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/veye/views/user/favorite_table.rb', line 15 def format(results) return if results.nil? items = results['favorites'] return if items.nil? items.each_with_index {|fav, index| @table << make_row(fav, index)} end |
#make_row(fav, index) ⇒ Object
11 12 13 |
# File 'lib/veye/views/user/favorite_table.rb', line 11 def make_row(fav, index) [index + 1, fav['name'], fav['prod_key'], fav['version'], fav['language']] end |