class Deployinator::Views::RunLogs

Constants

PER_PAGE

Public Instance Methods

files() click to toggle source

Internal: fetches the run_log files to be displayed in a list view

Returns an array of hashes with name, time keys

# File lib/deployinator/views/run_logs.rb, line 21
def files
  page = get_page
  offset = PER_PAGE * page
  get_run_logs(:limit => PER_PAGE, :offset => offset)
end
get_page() click to toggle source
# File lib/deployinator/views/run_logs.rb, line 27
def get_page
  @params['page'].to_i || 0
end
next_page() click to toggle source

Internal: determines what the next page number is.

Returns the next page number

# File lib/deployinator/views/run_logs.rb, line 11
def next_page
  page = get_page
  num_run_logs = get_run_logs.count
  return (page+1)*PER_PAGE < num_run_logs ? page + 1 : false
end