Class: LeanCms::BaseComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/lean_cms/base_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page: nil, **options) ⇒ BaseComponent

Returns a new instance of BaseComponent.



5
6
7
8
# File 'app/components/lean_cms/base_component.rb', line 5

def initialize(page: nil, **options)
  @page = page || @view_context.instance_variable_get(:@page)
  super(**options)
end

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page.



3
4
5
# File 'app/components/lean_cms/base_component.rb', line 3

def page
  @page
end