Class: Choosy::DSL::SuperCommandBuilder
Constant Summary
collapse
- HELP =
:help
- SUPER =
:__SUPER_COMMAND__
Instance Attribute Summary
#entity
Instance Method Summary
collapse
#boolean, #boolean_, #enum, #enum_, #heading, #help, #initialize, #no_color, #option, #para, #printer, #summary, #version
#evaluate!, #method_missing
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Choosy::DSL::BaseBuilder
Instance Method Details
#command(cmd, &block) ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/choosy/dsl/super_command_builder.rb', line 6
def command(cmd, &block)
subcommand = if cmd == :help
help_command
elsif cmd.is_a?(Choosy::Command)
cmd.parent = entity
cmd
else
Choosy::Command.new(cmd, entity)
end
evaluate_command_builder!(subcommand.builder, &block)
end
|
#default(cmd) ⇒ Object
27
28
29
|
# File 'lib/choosy/dsl/super_command_builder.rb', line 27
def default(cmd)
@entity.default_command = cmd
end
|
23
24
25
|
# File 'lib/choosy/dsl/super_command_builder.rb', line 23
def metaname(meta)
@entity.metaname = meta
end
|
#parsimonious ⇒ Object
19
20
21
|
# File 'lib/choosy/dsl/super_command_builder.rb', line 19
def parsimonious
@entity.parsimonious = true
end
|