class Bumbleworks::Api::ProcessesController

Public Instance Methods

index() click to toggle source
# File lib/bumbleworks/api/controllers/processes_controller.rb, line 4
def index
  processes = Bumbleworks::Process.all(:limit => limit, :offset => offset)
  render :json => Bumbleworks::Api::ProcessPresenter.present(processes)
end
show() click to toggle source
# File lib/bumbleworks/api/controllers/processes_controller.rb, line 9
def show
  process = Bumbleworks::Process.new(params[:id])
  render :json => Bumbleworks::Api::ProcessPresenter.present(process)
end

Private Instance Methods

limit() click to toggle source
# File lib/bumbleworks/api/controllers/processes_controller.rb, line 20
def limit
  params.fetch(:limit) { 10 }.to_i
end
offset() click to toggle source
# File lib/bumbleworks/api/controllers/processes_controller.rb, line 24
def offset
  (page - 1) * limit
end
page() click to toggle source
# File lib/bumbleworks/api/controllers/processes_controller.rb, line 16
def page
  params.fetch(:page) { 1 }.to_i
end