Class: Yap::Cli::Options::Generate::Addon
- Inherits:
-
Object
- Object
- Yap::Cli::Options::Generate::Addon
- Includes:
- Yap::Cli::OptionsLoader
- Defined in:
- lib/yap/cli/options/generate/addon.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:) ⇒ Addon
constructor
A new instance of Addon.
- #parse(args) ⇒ Object
Methods included from Yap::Cli::OptionsLoader
#load_command, #load_constant_from_path, #load_relative_constant
Constructor Details
#initialize(options:) ⇒ Addon
Returns a new instance of Addon.
8 9 10 11 |
# File 'lib/yap/cli/options/generate/addon.rb', line 8 def initialize(options:) @options = @exit_status = 0 end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
6 7 8 |
# File 'lib/yap/cli/options/generate/addon.rb', line 6 def command @command end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/yap/cli/options/generate/addon.rb', line 6 def @options end |
Instance Method Details
#help_message ⇒ Object
28 29 30 |
# File 'lib/yap/cli/options/generate/addon.rb', line 28 def option_parser.to_s end |
#parse(args) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/yap/cli/options/generate/addon.rb', line 13 def parse(args) @addon_name = args.shift unless args.first =~ /^-/ unless @addon_name args.unshift '--help' STDERR.puts "Missing addon-name!" @exit_status = 1 puts end option_parser.order!(args) end |