Class: Spree::BackendConfiguration::MenuItem
- Inherits:
-
Object
- Object
- Spree::BackendConfiguration::MenuItem
- Defined in:
- lib/spree/backend_configuration.rb
Overview
An item which should be drawn in the admin menu
Instance Attribute Summary collapse
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#match_path ⇒ Object
readonly
Returns the value of attribute match_path.
-
#partial ⇒ Object
readonly
Returns the value of attribute partial.
-
#position ⇒ Object
Returns the value of attribute position.
-
#sections ⇒ Object
readonly
Returns the value of attribute sections.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(sections, icon, condition: nil, label: nil, partial: nil, url: nil, position: nil, match_path: nil) ⇒ MenuItem
constructor
A new instance of MenuItem.
Constructor Details
#initialize(sections, icon, condition: nil, label: nil, partial: nil, url: nil, position: nil, match_path: nil) ⇒ MenuItem
Returns a new instance of MenuItem.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/spree/backend_configuration.rb', line 47 def initialize( sections, icon, condition: nil, label: nil, partial: nil, url: nil, position: nil, match_path: nil ) @condition = condition || -> { true } @sections = sections @icon = icon @label = label || sections.first @partial = partial @url = url @position = position @match_path = match_path end |
Instance Attribute Details
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
28 29 30 |
# File 'lib/spree/backend_configuration.rb', line 28 def condition @condition end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
28 29 30 |
# File 'lib/spree/backend_configuration.rb', line 28 def icon @icon end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
28 29 30 |
# File 'lib/spree/backend_configuration.rb', line 28 def label @label end |
#match_path ⇒ Object (readonly)
Returns the value of attribute match_path.
28 29 30 |
# File 'lib/spree/backend_configuration.rb', line 28 def match_path @match_path end |
#partial ⇒ Object (readonly)
Returns the value of attribute partial.
28 29 30 |
# File 'lib/spree/backend_configuration.rb', line 28 def partial @partial end |
#position ⇒ Object
Returns the value of attribute position.
30 31 32 |
# File 'lib/spree/backend_configuration.rb', line 30 def position @position end |
#sections ⇒ Object (readonly)
Returns the value of attribute sections.
28 29 30 |
# File 'lib/spree/backend_configuration.rb', line 28 def sections @sections end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
28 29 30 |
# File 'lib/spree/backend_configuration.rb', line 28 def url @url end |