Class: Madmin::Menu::Item

Inherits:
Object
  • Object
show all
Includes:
Node
Defined in:
lib/madmin/menu.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Node

#add, #items

Constructor Details

#initialize(label:, url: nil, position: 99, parent: nil, **options) ⇒ Item

Returns a new instance of Item.



60
61
62
63
64
65
66
67
# File 'lib/madmin/menu.rb', line 60

def initialize(label:, url: nil, position: 99, parent: nil, **options)
  @label = label
  @url = url
  @position = position
  @parent = parent
  @if = options.delete(:if)
  @children = {}
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



58
59
60
# File 'lib/madmin/menu.rb', line 58

def children
  @children
end

#labelObject (readonly)

Returns the value of attribute label.



58
59
60
# File 'lib/madmin/menu.rb', line 58

def label
  @label
end

#parentObject (readonly)

Returns the value of attribute parent.



58
59
60
# File 'lib/madmin/menu.rb', line 58

def parent
  @parent
end

#positionObject (readonly)

Returns the value of attribute position.



58
59
60
# File 'lib/madmin/menu.rb', line 58

def position
  @position
end

#urlObject (readonly)

Returns the value of attribute url.



58
59
60
# File 'lib/madmin/menu.rb', line 58

def url
  @url
end