Class: Yap::Cli::Options::Addon::Search
- Inherits:
-
Object
- Object
- Yap::Cli::Options::Addon::Search
- Includes:
- Yap::Cli::OptionsLoader
- Defined in:
- lib/yap/cli/options/addon/search.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #help_message ⇒ Object
-
#initialize(options:) ⇒ Search
constructor
A new instance of Search.
- #parse(args) ⇒ Object
Methods included from Yap::Cli::OptionsLoader
#load_command, #load_constant_from_path, #load_relative_constant
Constructor Details
#initialize(options:) ⇒ Search
Returns a new instance of Search.
8 9 10 |
# File 'lib/yap/cli/options/addon/search.rb', line 8 def initialize(options:) @options = end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
6 7 8 |
# File 'lib/yap/cli/options/addon/search.rb', line 6 def command @command end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/yap/cli/options/addon/search.rb', line 6 def @options end |
Instance Method Details
#help_message ⇒ Object
25 26 27 |
# File 'lib/yap/cli/options/addon/search.rb', line 25 def option_parser.to_s end |
#parse(args) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/yap/cli/options/addon/search.rb', line 12 def parse(args) search_terms = [] while args.any? option_parser.order!(args) search_terms << args.shift end command.search_term = search_terms.shift end |