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.



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

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.



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

def items
  @items
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

#positionObject (readonly)

Returns the value of attribute position.



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

def position
  @position
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end