Class: Grapevine::API

Inherits:
Grape::API
  • Object
show all
Defined in:
lib/grapevine/api.rb

Class Method Summary collapse

Class Method Details

.mount_helpers(app_helpers = []) ⇒ Object

It will call grape#helpers method for each helper module included

Parameters:

  • Helpers Modules to be included in the app



6
7
8
9
10
# File 'lib/grapevine/api.rb', line 6

def self.mount_helpers(app_helpers=[])
  app_helpers.each do |helper|
    helpers helper
  end
end

.mount_routes(app_routes = []) ⇒ Object

It will call grape#mount method for each route to include

Parameters:

  • Routes Class to be included in the main app



14
15
16
17
18
# File 'lib/grapevine/api.rb', line 14

def self.mount_routes(app_routes=[])
  app_routes.each do |route|
    mount route
  end
end