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.
21 22 23 24 25 26 |
# File 'lib/pages_core/admin_menu_item.rb', line 21 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.
5 6 7 |
# File 'lib/pages_core/admin_menu_item.rb', line 5 def group @group end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
5 6 7 |
# File 'lib/pages_core/admin_menu_item.rb', line 5 def label @label end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/pages_core/admin_menu_item.rb', line 5 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/pages_core/admin_menu_item.rb', line 5 def path @path end |
Class Method Details
.items ⇒ Object
8 9 10 11 12 |
# File 'lib/pages_core/admin_menu_item.rb', line 8 def items return [] unless @menu_items @menu_items.map { |_, v| v } end |
.register(label, path, group = :custom, options = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/pages_core/admin_menu_item.rb', line 14 def register(label, path, group = :custom, = {}) entry = new(label, path, group, ) @menu_items ||= {} @menu_items[[group, label]] = entry end |
Instance Method Details
#==(other) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/pages_core/admin_menu_item.rb', line 28 def ==(other) other && other.label == label && other.path == path && other.group == group && other. == end |