Class: Rh::Command
- Inherits:
-
Object
- Object
- Rh::Command
- Defined in:
- lib/rh/command.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ Command
Returns a new instance of Command.
6 7 8 9 |
# File 'lib/rh/command.rb', line 6 def initialize(args) @args = args @version = Rh.ruby_version end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rh/command.rb', line 11 def run if @args.empty? exit_with_error("Please provide an argument:\n$ rh Array#shift") and return end if @args.length > 1 exit_with_error("Too many arguments!") and return end arg = @args.first.strip show(arg) end |