Class: Easy::Configuration::MenuCustomLink
- Defined in:
- lib/easy/configuration/menu_custom_link.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
Attributes inherited from MenuItem
#children, #html_options, #link_setup
Instance Method Summary collapse
-
#initialize(options = {}, &block) ⇒ MenuCustomLink
constructor
A new instance of MenuCustomLink.
- #title ⇒ Object
- #url(view_context, decorator) ⇒ Object
Methods inherited from MenuTitle
Methods inherited from MenuItem
Constructor Details
#initialize(options = {}, &block) ⇒ MenuCustomLink
Returns a new instance of MenuCustomLink.
7 8 9 10 11 12 13 |
# File 'lib/easy/configuration/menu_custom_link.rb', line 7 def initialize( = {}, &block) @url = .delete(:url) @title = .delete(:title) @icon = .delete(:icon) super(, &block) end |
Instance Attribute Details
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
5 6 7 |
# File 'lib/easy/configuration/menu_custom_link.rb', line 5 def icon @icon end |
Instance Method Details
#title ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/easy/configuration/menu_custom_link.rb', line 15 def title case @title when String @title else I18n.t(@title) end end |
#url(view_context, decorator) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/easy/configuration/menu_custom_link.rb', line 24 def url(view_context, decorator) case @url when Proc @url.call(view_context, decorator) end end |