Module: GitCommander::CommandLoaderOptions
- Included in:
- Command
- Defined in:
- lib/git_commander/command_loader_options.rb
Overview
Establishes values to be set by loaders
Instance Method Summary collapse
- #argument(arg_name, options = {}) ⇒ Object
- #description(value = nil) ⇒ Object
- #flag(flag_name, options = {}) ⇒ Object
- #on_run(&on_run) ⇒ Object
- #summary(value = nil) ⇒ Object
- #switch(switch_name, options = {}) ⇒ Object
Instance Method Details
#argument(arg_name, options = {}) ⇒ Object
18 19 20 |
# File 'lib/git_commander/command_loader_options.rb', line 18 def argument(arg_name, = {}) add_option :argument, .merge(name: arg_name) end |
#description(value = nil) ⇒ Object
12 13 14 15 16 |
# File 'lib/git_commander/command_loader_options.rb', line 12 def description(value = nil) return @description = value if value @description end |
#flag(flag_name, options = {}) ⇒ Object
22 23 24 |
# File 'lib/git_commander/command_loader_options.rb', line 22 def flag(flag_name, = {}) add_option :flag, .merge(name: flag_name) end |
#on_run(&on_run) ⇒ Object
30 31 32 |
# File 'lib/git_commander/command_loader_options.rb', line 30 def on_run(&on_run) @block = on_run end |
#summary(value = nil) ⇒ Object
6 7 8 9 10 |
# File 'lib/git_commander/command_loader_options.rb', line 6 def summary(value = nil) return @summary = value if value @summary end |
#switch(switch_name, options = {}) ⇒ Object
26 27 28 |
# File 'lib/git_commander/command_loader_options.rb', line 26 def switch(switch_name, = {}) add_option :switch, .merge(name: switch_name) end |