Class: ForgeCLI::PostPostHooks

Inherits:
PostHooks show all
Defined in:
lib/forge-cli/modules/posts/post_hooks.rb

Instance Method Summary collapse

Methods inherited from PostHooks

#initialize, run!

Constructor Details

This class inherits a constructor from ForgeCLI::PostHooks

Instance Method Details

#add_controller_moduleObject



14
15
16
17
18
# File 'lib/forge-cli/modules/posts/post_hooks.rb', line 14

def add_controller_module
  STDOUT.puts "Adding Posts controller methods..."
  cmi = ForgeCLI::ControllerModuleIncluder.new(@app, 'posts')
  cmi.run!
end

#add_routesObject



7
8
9
10
11
12
# File 'lib/forge-cli/modules/posts/post_hooks.rb', line 7

def add_routes
  STDOUT.puts "Adding Routes..."
  ri = ForgeCLI::RouteInstaller.new(@app, module_path)
  ri.install_routes
  ri.install_routes(:forge)
end

#module_pathObject



20
21
22
# File 'lib/forge-cli/modules/posts/post_hooks.rb', line 20

def module_path
  File.dirname(__FILE__)
end

#run!Object



2
3
4
5
# File 'lib/forge-cli/modules/posts/post_hooks.rb', line 2

def run!
  add_routes
  add_controller_module
end