Class: Maglev::Uikit::AppLayout::Topbar::PageInfoComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Maglev::Uikit::AppLayout::Topbar::PageInfoComponent
- Defined in:
- app/components/maglev/uikit/app_layout/topbar/page_info_component.rb
Instance Attribute Summary collapse
-
#live_page_url ⇒ Object
readonly
Returns the value of attribute live_page_url.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#prefix_page_path ⇒ Object
readonly
Returns the value of attribute prefix_page_path.
Instance Method Summary collapse
- #icon_name ⇒ Object
-
#initialize(page:, paths:, live_page_url:, prefix_page_path:) ⇒ PageInfoComponent
constructor
A new instance of PageInfoComponent.
- #page_path ⇒ Object
Constructor Details
#initialize(page:, paths:, live_page_url:, prefix_page_path:) ⇒ PageInfoComponent
Returns a new instance of PageInfoComponent.
10 11 12 13 14 15 |
# File 'app/components/maglev/uikit/app_layout/topbar/page_info_component.rb', line 10 def initialize(page:, paths:, live_page_url:, prefix_page_path:) @page = page @paths = paths @live_page_url = live_page_url @prefix_page_path = prefix_page_path end |
Instance Attribute Details
#live_page_url ⇒ Object (readonly)
Returns the value of attribute live_page_url.
8 9 10 |
# File 'app/components/maglev/uikit/app_layout/topbar/page_info_component.rb', line 8 def live_page_url @live_page_url end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
8 9 10 |
# File 'app/components/maglev/uikit/app_layout/topbar/page_info_component.rb', line 8 def page @page end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
8 9 10 |
# File 'app/components/maglev/uikit/app_layout/topbar/page_info_component.rb', line 8 def paths @paths end |
#prefix_page_path ⇒ Object (readonly)
Returns the value of attribute prefix_page_path.
8 9 10 |
# File 'app/components/maglev/uikit/app_layout/topbar/page_info_component.rb', line 8 def prefix_page_path @prefix_page_path end |
Instance Method Details
#icon_name ⇒ Object
17 18 19 |
# File 'app/components/maglev/uikit/app_layout/topbar/page_info_component.rb', line 17 def icon_name page.index? ? 'home' : 'file' end |
#page_path ⇒ Object
21 22 23 |
# File 'app/components/maglev/uikit/app_layout/topbar/page_info_component.rb', line 21 def page_path "#{prefix_page_path}#{page.path.presence || page.default_path}" end |