Module: Interactive
- Included in:
- NonEmptyOptions
- Defined in:
- lib/interactive/option.rb,
lib/interactive/options.rb,
lib/interactive/version.rb,
lib/interactive/question.rb,
lib/interactive/response.rb
Defined Under Namespace
Classes: EmptyOptions, HashNumberedOption, NonEmptyOptions, Question, ResponseWithArgs, ResponseWithNoArgs, WholeNumberOption, WordOption
Constant Summary
collapse
- VERSION =
"0.4.0"
Class Method Summary
collapse
Class Method Details
.Option(option) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/interactive/option.rb', line 6
def Option(option)
if option.respond_to?(:to_hash)
@option = HashNumberedOption.new(option)
elsif option.to_s.match(/^\d+$/)
@option = WholeNumberOption.new(option)
else
@option = WordOption.new(option)
end
@option
end
|
.Options(options = []) ⇒ Object
.Response(*args) ⇒ Object