Class: Yap::Cli::Options::Generate

Inherits:
Object
  • Object
show all
Includes:
Yap::Cli::OptionsLoader
Defined in:
lib/yap/cli/options/generate.rb

Defined Under Namespace

Classes: Addon

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Yap::Cli::OptionsLoader

#load_command, #load_constant_from_path, #load_relative_constant

Constructor Details

#initialize(options:) ⇒ Generate

Returns a new instance of Generate.



8
9
10
11
# File 'lib/yap/cli/options/generate.rb', line 8

def initialize(options:)
  @options = options
  @exit_status = 0
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



6
7
8
# File 'lib/yap/cli/options/generate.rb', line 6

def command
  @command
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/yap/cli/options/generate.rb', line 6

def options
  @options
end

Instance Method Details

#parse(args) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/yap/cli/options/generate.rb', line 13

def parse(args)
  if args.empty?
    args.unshift '--help'
    STDERR.puts "generate must be called with a component type!"
    @exit_status = 1
    puts
  end

  option_parser.order!(args)
end