Class: PagesCore::AdminMenuItem
- Inherits:
-
Object
- Object
- PagesCore::AdminMenuItem
- Defined in:
- lib/pages_core/admin_menu_item.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(label, path, group = :custom, options = {}) ⇒ AdminMenuItem
constructor
A new instance of AdminMenuItem.
Constructor Details
#initialize(label, path, group = :custom, options = {}) ⇒ AdminMenuItem
Returns a new instance of AdminMenuItem.
18 19 20 21 22 23 |
# File 'lib/pages_core/admin_menu_item.rb', line 18 def initialize(label, path, group = :custom, = {}) @label = label @path = path @group = group @options = end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
3 4 5 |
# File 'lib/pages_core/admin_menu_item.rb', line 3 def group @group end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
3 4 5 |
# File 'lib/pages_core/admin_menu_item.rb', line 3 def label @label end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/pages_core/admin_menu_item.rb', line 3 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/pages_core/admin_menu_item.rb', line 3 def path @path end |
Class Method Details
.items ⇒ Object
6 7 8 9 |
# File 'lib/pages_core/admin_menu_item.rb', line 6 def items return [] unless @menu_items @menu_items.map { |_, v| v } end |
.register(label, path, group = :custom, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/pages_core/admin_menu_item.rb', line 11 def register(label, path, group = :custom, = {}) entry = new(label, path, group, ) @menu_items ||= {} @menu_items[[group, label]] = entry end |
Instance Method Details
#==(other) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/pages_core/admin_menu_item.rb', line 25 def ==(other) other && other.label == label && other.path == path && other.group == group && other. == end |