Class: Parts::Base

Inherits:
AbstractController::Base
  • Object
show all
Includes:
AbstractController::Callbacks, AbstractController::Layouts, AbstractController::Rendering, AbstractController::Translation, ActionController::Helpers, ActionController::ImplicitRender, DefaultLayout, Helpers
Defined in:
lib/parts/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#part

Methods included from DefaultLayout

#_default_layout

Constructor Details

#initialize(controller, params) ⇒ Base

Returns a new instance of Base.



16
17
18
19
20
21
# File 'lib/parts/base.rb', line 16

def initialize(controller, params)
  @controller = controller
  @params = controller.params.dup
  @params.merge!(params) unless params.empty?
  self.formats = controller.formats
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



6
7
8
# File 'lib/parts/base.rb', line 6

def controller
  @controller
end

#paramsObject (readonly)

Returns the value of attribute params.



6
7
8
# File 'lib/parts/base.rb', line 6

def params
  @params
end

Class Method Details

.inherited(klass) ⇒ Object



28
29
30
31
# File 'lib/parts/base.rb', line 28

def self.inherited(klass)
  super
  klass.helper :all
end