Class: Veye::User::ProfileCSV

Inherits:
BaseCSV
  • Object
show all
Defined in:
lib/veye/views/user/profile_csv.rb

Instance Method Summary collapse

Methods inherited from BaseCSV

#after, #before

Constructor Details

#initializeProfileCSV

Returns a new instance of ProfileCSV.



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

def initialize
  headers = "username,fullname,email,plan_name_id,admin,new_notifications,total_notifications"
  super(headers)
end

Instance Method Details

#format(results) ⇒ Object



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

def format(results)
  return nil if results.nil?
  printf("%s,%s,%s,%s,%s,%s,%s\n",
        results['username'],
        results['fullname'],
        results['email'],
        results['plan_name_id'],
        results['admin'],
        results['notifications']['new'],
        results['notifications']['total'])
end