Class: Tarquinn::Controller
- Inherits:
-
Object
- Object
- Tarquinn::Controller
- Defined in:
- lib/tarquinn/controller.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
- #call(method, *args) ⇒ Object
- #has_method?(method) ⇒ Boolean
-
#initialize(controller) ⇒ Controller
constructor
A new instance of Controller.
- #params ⇒ Object
Constructor Details
#initialize(controller) ⇒ Controller
Returns a new instance of Controller.
4 5 6 |
# File 'lib/tarquinn/controller.rb', line 4 def initialize(controller) @controller = controller end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
2 3 4 |
# File 'lib/tarquinn/controller.rb', line 2 def controller @controller end |
Instance Method Details
#call(method, *args) ⇒ Object
12 13 14 |
# File 'lib/tarquinn/controller.rb', line 12 def call(method, *args) controller.send(method, *args) end |
#has_method?(method) ⇒ Boolean
16 17 18 |
# File 'lib/tarquinn/controller.rb', line 16 def has_method?(method) controller.respond_to?(method, true) end |
#params ⇒ Object
8 9 10 |
# File 'lib/tarquinn/controller.rb', line 8 def params @params ||= controller.send(:params) end |