Class: Interactive::NonEmptyOptions
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Interactive::NonEmptyOptions
show all
- Includes:
- Interactive
- Defined in:
- lib/interactive/options.rb
Constant Summary
Constants included
from Interactive
VERSION
Instance Method Summary
collapse
Option, Options, Response
Constructor Details
Returns a new instance of NonEmptyOptions.
12
13
14
15
16
17
|
# File 'lib/interactive/options.rb', line 12
def initialize(options)
@options = options
flatten_ranges(@options)
wrap_each_option
super(@options)
end
|
Instance Method Details
#has_hash? ⇒ Boolean
27
28
29
|
# File 'lib/interactive/options.rb', line 27
def has_hash?
@options.any? {|opt| opt.respond_to?(:to_hash) }
end
|
#shortcuts_meanings ⇒ Object
23
24
25
|
# File 'lib/interactive/options.rb', line 23
def shortcuts_meanings
@options.inject("") { |accum, opt| "#{accum} #{opt.shortcut_value} -- #{opt.value}\n"}
end
|
#shortcuts_string ⇒ Object
19
20
21
|
# File 'lib/interactive/options.rb', line 19
def shortcuts_string
"[#{first_chars_without_last_slash(first_chars)}]"
end
|