Module: Flame::Controller::ParentActions

Defined in:
lib/flame/controller.rb

Overview

Module for public instance methods re-defining from superclass

Examples:

Inherit controller with parent actions by extend

class MyController < BaseController
  extend Flame::Controller::ParentActions
end

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(ctrl) ⇒ Object



141
142
143
# File 'lib/flame/controller.rb', line 141

def self.extended(ctrl)
	ctrl.define_parent_actions
end

Instance Method Details

#define_parent_actions ⇒ Object



145
146
147
148
149
150
# File 'lib/flame/controller.rb', line 145

def define_parent_actions
	superclass.actions.each do |public_method|
		um = superclass.public_instance_method(public_method)
		define_method public_method, um
	end
end

#inherited(ctrl) ⇒ Object



137
138
139
# File 'lib/flame/controller.rb', line 137

def inherited(ctrl)
	ctrl.define_parent_actions
end