Class: ExpressAdmin::Menu::MenuItem
- Inherits:
-
Object
- Object
- ExpressAdmin::Menu::MenuItem
- Defined in:
- lib/express_admin/menu.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(hash) ⇒ MenuItem
constructor
A new instance of MenuItem.
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
#items ⇒ Object (readonly)
Returns the value of attribute items.
46 47 48 |
# File 'lib/express_admin/menu.rb', line 46 def items @items end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
46 47 48 |
# File 'lib/express_admin/menu.rb', line 46 def path @path end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
46 47 48 |
# File 'lib/express_admin/menu.rb', line 46 def position @position end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
46 47 48 |
# File 'lib/express_admin/menu.rb', line 46 def title @title end |