Method: Bundler::Thor::Base::ClassMethods#public_command
- Defined in:
- lib/bundler/vendor/thor/lib/thor/base.rb
#public_command(*names) ⇒ Object Also known as: public_task
Allows to use private methods from parent in child classes as commands.
Parameters
names<Array>:: Method names to be used as commands
Examples
public_command :foo
public_command :foo, :bar, :baz
462 463 464 465 466 |
# File 'lib/bundler/vendor/thor/lib/thor/base.rb', line 462 def public_command(*names) names.each do |name| class_eval "def #{name}(*); super end" end end |