Class: Spree::BackendConfiguration::MenuItem
- Inherits:
-
Object
- Object
- Spree::BackendConfiguration::MenuItem
- Defined in:
- app/models/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.
-
#partial ⇒ Object
readonly
Returns the value of attribute partial.
-
#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) ⇒ MenuItem
constructor
A new instance of MenuItem.
Constructor Details
#initialize(sections, icon, condition: nil, label: nil, partial: nil, url: nil) ⇒ MenuItem
Returns a new instance of MenuItem.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'app/models/spree/backend_configuration.rb', line 36 def initialize( sections, icon, condition: nil, label: nil, partial: nil, url: nil ) @condition = condition || -> { true } @sections = sections @icon = icon @label = label || sections.first @partial = partial @url = url end |
Instance Attribute Details
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
23 24 25 |
# File 'app/models/spree/backend_configuration.rb', line 23 def condition @condition end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
23 24 25 |
# File 'app/models/spree/backend_configuration.rb', line 23 def icon @icon end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
23 24 25 |
# File 'app/models/spree/backend_configuration.rb', line 23 def label @label end |
#partial ⇒ Object (readonly)
Returns the value of attribute partial.
23 24 25 |
# File 'app/models/spree/backend_configuration.rb', line 23 def partial @partial end |
#sections ⇒ Object (readonly)
Returns the value of attribute sections.
23 24 25 |
# File 'app/models/spree/backend_configuration.rb', line 23 def sections @sections end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
23 24 25 |
# File 'app/models/spree/backend_configuration.rb', line 23 def url @url end |