Class: Gamefic::Props::YesOrNo
- Inherits:
-
MultipleChoice
- Object
- Default
- MultipleChoice
- Gamefic::Props::YesOrNo
- Defined in:
- lib/gamefic/props/yes_or_no.rb
Overview
A MultipleChoice variant that only allows Yes or No.
Instance Attribute Summary
Attributes inherited from MultipleChoice
Attributes inherited from Default
#context, #input, #prompt, #scene
Instance Method Summary collapse
Methods inherited from MultipleChoice
Methods inherited from Default
Constructor Details
This class inherits a constructor from Gamefic::Props::Default
Instance Method Details
#no? ⇒ Boolean
12 13 14 |
# File 'lib/gamefic/props/yes_or_no.rb', line 12 def no? selection == 'No' end |
#options ⇒ Object
16 17 18 |
# File 'lib/gamefic/props/yes_or_no.rb', line 16 def @options ||= %w[Yes No].freeze end |
#yes? ⇒ Boolean
8 9 10 |
# File 'lib/gamefic/props/yes_or_no.rb', line 8 def yes? selection == 'Yes' end |