class Bumbleworks::Api::EntitiesController
Public Instance Methods
index()
click to toggle source
# File lib/bumbleworks/api/controllers/entities_controller.rb, line 8 def index render :json => EntityPresenter.present(entity_class.all) end
show()
click to toggle source
# File lib/bumbleworks/api/controllers/entities_controller.rb, line 12 def show entity = entity_class.first_by_identifier(params[:id]) render :json => EntityPresenter.present(entity) end
types()
click to toggle source
# File lib/bumbleworks/api/controllers/entities_controller.rb, line 4 def types render :json => EntityClassPresenter.present(Bumbleworks.entity_classes) end
Private Instance Methods
entity_class()
click to toggle source
# File lib/bumbleworks/api/controllers/entities_controller.rb, line 19 def entity_class class_name = Bumbleworks::Support.camelize(params[:type]) entity_class = Bumbleworks::Support.constantize(class_name) end