Class: RedBird::VerticalMenu::Option
- Inherits:
-
Object
- Object
- RedBird::VerticalMenu::Option
- Defined in:
- lib/red_bird/vertical_menu.rb
Overview
An option to be used in RedBird::VerticalMenu.
Instance Attribute Summary collapse
-
#action ⇒ Proc
Code for option selection.
-
#text ⇒ String
Option name.
Instance Method Summary collapse
-
#initialize(text, &action) ⇒ Option
constructor
A new instance of Option.
Constructor Details
#initialize(text, &action) ⇒ Option
Returns a new instance of Option.
24 25 26 27 28 |
# File 'lib/red_bird/vertical_menu.rb', line 24 def initialize(text, &action) @text = text @action = action @priority = 100 end |
Instance Attribute Details
#action ⇒ Proc
Returns code for option selection.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/red_bird/vertical_menu.rb', line 18 class Option attr_accessor :action, :text # @param text [String] option name # @param action [Proc] code to use when this option is selected # @author Frederico Linhares def initialize(text, &action) @text = text @action = action @priority = 100 end end |
#text ⇒ String
Returns option name.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/red_bird/vertical_menu.rb', line 18 class Option attr_accessor :action, :text # @param text [String] option name # @param action [Proc] code to use when this option is selected # @author Frederico Linhares def initialize(text, &action) @text = text @action = action @priority = 100 end end |