Class: ActiveAdmin::MenuItem

Inherits:
Object
  • Object
show all
Defined in:
lib/active_material_icon/menu_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ MenuItem

Returns a new instance of MenuItem.

Yields:

  • (_self)

Yield Parameters:



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/active_material_icon/menu_item.rb', line 6

def initialize(options = {})
  super() # MenuNode
  @icon           = "<i class='material-icons'>#{options[:icon] || "arrow_right" }</i>"
  @label          = options[:label]
  @dirty_id       = options[:id]           || options[:label]
  @url            = options[:url]          || '#'
  @priority       = options[:priority]     || 10
  @html_options   = options[:html_options] || {}
  @should_display = options[:if]           || proc { true }
  @parent         = options[:parent]

  yield(self) if block_given? # Builder style syntax
end

Instance Attribute Details

#iconObject (readonly)

Returns the value of attribute icon.



4
5
6
# File 'lib/active_material_icon/menu_item.rb', line 4

def icon
  @icon
end