Class: SlackQuestionAbilities::Option
- Inherits:
-
Object
- Object
- SlackQuestionAbilities::Option
- Defined in:
- src/abilities/slack_question_abilities.rb
Instance Attribute Summary collapse
-
#label ⇒ String
(also: #to_s)
readonly
The text that is presented to the user.
-
#matcher ⇒ String, Regexp
readonly
The matcher used for unnumbered option questions.
-
#value ⇒ Object
readonly
The value that is returned when a choice is made.
Instance Method Summary collapse
-
#initialize(label, value, matcher = label) ⇒ Option
constructor
Construct a new instance of Option.
Constructor Details
#initialize(label, value, matcher = label) ⇒ Option
Construct a new instance of Option
17 18 19 20 21 |
# File 'src/abilities/slack_question_abilities.rb', line 17 def initialize(label, value, matcher = label) @label = label @value = value @matcher = matcher end |
Instance Attribute Details
#label ⇒ String (readonly) Also known as: to_s
Returns the text that is presented to the user
4 5 6 |
# File 'src/abilities/slack_question_abilities.rb', line 4 def label @label end |
#matcher ⇒ String, Regexp (readonly)
Returns the matcher used for unnumbered option questions
10 11 12 |
# File 'src/abilities/slack_question_abilities.rb', line 10 def matcher @matcher end |
#value ⇒ Object (readonly)
Returns the value that is returned when a choice is made
7 8 9 |
# File 'src/abilities/slack_question_abilities.rb', line 7 def value @value end |