Class: Gamefic::Props::YesOrNo
Overview
A MultipleChoice variant that only allows Yes or No.
Instance Attribute Summary
#invalid_message
Attributes inherited from Default
#context, #input, #prompt
Instance Method Summary
collapse
#index, #number, #selection
Methods inherited from Default
#initialize
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
@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
|