Class: Alchemy::Menubar

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/alchemy/menubar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page: Alchemy::Current.page) ⇒ Menubar

Returns a new instance of Menubar.



7
8
9
# File 'app/components/alchemy/menubar.rb', line 7

def initialize(page: Alchemy::Current.page)
  @page = page
end

Instance Attribute Details

#page ⇒ Object (readonly)

Returns the value of attribute page.



3
4
5
# File 'app/components/alchemy/menubar.rb', line 3

def page
  @page
end

Instance Method Details

#render? ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/components/alchemy/menubar.rb', line 11

def render?
  page && !Alchemy::Current.preview_page? && can?(:edit_content, page)
end