Class: Spree::BackendConfiguration::MenuItem

Inherits:
Object
  • Object
show all
Defined in:
app/models/spree/backend_configuration.rb

Overview

An item which should be drawn in the admin menu

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sections, icon, condition: nil, label: nil, partial: nil, url: nil) ⇒ MenuItem



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'app/models/spree/backend_configuration.rb', line 38

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

#conditionObject (readonly)

Returns the value of attribute condition.



25
26
27
# File 'app/models/spree/backend_configuration.rb', line 25

def condition
  @condition
end

#iconObject (readonly)

Returns the value of attribute icon.



25
26
27
# File 'app/models/spree/backend_configuration.rb', line 25

def icon
  @icon
end

#labelObject (readonly)

Returns the value of attribute label.



25
26
27
# File 'app/models/spree/backend_configuration.rb', line 25

def label
  @label
end

#partialObject (readonly)

Returns the value of attribute partial.



25
26
27
# File 'app/models/spree/backend_configuration.rb', line 25

def partial
  @partial
end

#sectionsObject (readonly)

Returns the value of attribute sections.



25
26
27
# File 'app/models/spree/backend_configuration.rb', line 25

def sections
  @sections
end

#urlObject (readonly)

Returns the value of attribute url.



25
26
27
# File 'app/models/spree/backend_configuration.rb', line 25

def url
  @url
end