Class: Cliffy::Internal::Wrapper
- Inherits:
-
Object
- Object
- Cliffy::Internal::Wrapper
- Defined in:
- lib/cliffy/internal/wrapper.rb
Instance Method Summary collapse
- #command_description ⇒ Object
- #command_name ⇒ Object
- #generate_help_data(executable_name) ⇒ Object
-
#initialize(command) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #run(arguments, executable_name) ⇒ Object
- #validate ⇒ Object
Constructor Details
#initialize(command) ⇒ Wrapper
Returns a new instance of Wrapper.
8 9 10 |
# File 'lib/cliffy/internal/wrapper.rb', line 8 def initialize command @command = command end |
Instance Method Details
#command_description ⇒ Object
16 17 18 |
# File 'lib/cliffy/internal/wrapper.rb', line 16 def command_description @command.description end |
#command_name ⇒ Object
12 13 14 |
# File 'lib/cliffy/internal/wrapper.rb', line 12 def command_name @command_name ||= @command.class.to_s.split('::').last.gsub(/([A-Z][a-z]+)([A-Z][a-z]+)/, '\1-\2').downcase end |
#generate_help_data(executable_name) ⇒ Object
24 25 26 |
# File 'lib/cliffy/internal/wrapper.rb', line 24 def generate_help_data executable_name Internal::generate_help_data @command, command_name, executable_name end |