Class: ExpressAdmin::Menu::MenuItem

Inherits:
Object
  • Object
show all
Defined in:
lib/express_admin/menu.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ MenuItem

Returns a new instance of MenuItem.



48
49
50
51
52
53
# File 'lib/express_admin/menu.rb', line 48

def initialize(hash)
  @title = hash[:title]
  @path = hash[:path]
  @position = hash[:position] || 99
  @items = (hash[:items]||[]).map {|item| MenuItem.new(item)}
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



47
48
49
# File 'lib/express_admin/menu.rb', line 47

def items
  @items
end

#pathObject (readonly)

Returns the value of attribute path.



47
48
49
# File 'lib/express_admin/menu.rb', line 47

def path
  @path
end

#positionObject (readonly)

Returns the value of attribute position.



47
48
49
# File 'lib/express_admin/menu.rb', line 47

def position
  @position
end

#titleObject (readonly)

Returns the value of attribute title.



47
48
49
# File 'lib/express_admin/menu.rb', line 47

def title
  @title
end