Class: BaseCSV

Inherits:
Object
  • Object
show all
Defined in:
lib/veye/views/base_csv.rb

Instance Method Summary collapse

Constructor Details

#initialize(headers) ⇒ BaseCSV

Returns a new instance of BaseCSV.



3
4
5
# File 'lib/veye/views/base_csv.rb', line 3

def initialize(headers)
  @columns = headers
end

Instance Method Details

#after(paging = nil, allow_pagination = false) ⇒ Object



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

def after(paging = nil, allow_pagination = false)
  if allow_pagination && !paging.nil?
    printf("# ------------------------------------------\n")
    printf("current_page,per_page,total_pages,total_entries\n")
    printf("%s,%s,%s,%s\n",
          paging['current_page'],
          paging['per_page'],
          paging['total_pages'],
          paging['total_entries'])
  end
end

#beforeObject



7
8
9
# File 'lib/veye/views/base_csv.rb', line 7

def before
  puts @columns
end

#format(results, n = 0, from = 0) ⇒ Object

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/veye/views/base_csv.rb', line 22

def format(results, n = 0, from = 0)
  raise NotImplementedError
end