Class: Veye::User::ProfileTable

Inherits:
BaseTable show all
Defined in:
lib/veye/views/user/profile_table.rb

Instance Method Summary collapse

Methods inherited from BaseTable

#after, #before

Constructor Details

#initializeProfileTable

Returns a new instance of ProfileTable.



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

def initialize
  headings = %w(
    username fullname email plan_name admin deleted
    new_notifications total_notifications
  )
  super("User's profile", headings)
end

Instance Method Details

#format(results) ⇒ Object



26
27
28
29
# File 'lib/veye/views/user/profile_table.rb', line 26

def format(results)
  return if results.nil?
  @table << make_row(results)
end

#make_row(profile, index = 0) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/veye/views/user/profile_table.rb', line 14

def make_row(profile, index = 0)
  row = [profile['username']]
  row << profile['fullname']
  row << profile['email']
  row << profile['plan_name_id']
  row << profile['admin']
  row << profile['deleted']
  row << profile['notifications']['new']
  row << profile['notifications']['total']
  return row
end