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.
18
19
20
21
22
23
|
# File 'lib/interactive/options.rb', line 18
def initialize(options)
@options = options
flatten_ranges(@options)
wrap_each_option
super(@options)
end
|
Instance Method Details
#has_hash? ⇒ Boolean
33
34
35
|
# File 'lib/interactive/options.rb', line 33
def has_hash?
@options.any? {|opt| opt.respond_to?(:to_hash) }
end
|
#shortcuts_meanings ⇒ Object
29
30
31
|
# File 'lib/interactive/options.rb', line 29
def shortcuts_meanings
@options.inject("") { |accum, opt| "#{accum} #{opt.shortcut_value} -- #{opt.value}\n"}
end
|
#shortcuts_string ⇒ Object
25
26
27
|
# File 'lib/interactive/options.rb', line 25
def shortcuts_string
"[#{OptionsShortcuts.new(first_chars_without_last_slash(first_chars)).minify}]"
end
|