Class: Satis::SidebarMenuItem::Component

Inherits:
ApplicationComponent show all
Defined in:
app/components/satis/sidebar_menu_item/component.rb

Direct Known Subclasses

Mobile::Component

Instance Attribute Summary collapse

Attributes inherited from ApplicationComponent

#original_view_context

Instance Method Summary collapse

Methods inherited from ApplicationComponent

add_helper, #component_name

Constructor Details

#initialize(**options) ⇒ Component

renders_many :items



10
11
12
13
14
# File 'app/components/satis/sidebar_menu_item/component.rb', line 10

def initialize(**options)
  @item = options[:item]
  @menu_options = options.fetch(:menu_options, {})
  @actions = item.link_attributes.delete(:'data-action')
end

Instance Attribute Details

#itemObject (readonly)

Returns the value of attribute item.



7
8
9
# File 'app/components/satis/sidebar_menu_item/component.rb', line 7

def item
  @item
end

Returns the value of attribute menu_options.



7
8
9
# File 'app/components/satis/sidebar_menu_item/component.rb', line 7

def menu_options
  @menu_options
end

Instance Method Details

#data_actionsObject



16
17
18
# File 'app/components/satis/sidebar_menu_item/component.rb', line 16

def data_actions
  "click->satis-sidebar-menu-item#open #{@actions}"
end