Class: GridCLI::PPrintCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- GridCLI::PPrintCommand
- Defined in:
- lib/gridcli/commands/pprint.rb
Instance Attribute Summary
Attributes inherited from BaseCommand
Instance Method Summary collapse
-
#initialize ⇒ PPrintCommand
constructor
A new instance of PPrintCommand.
- #run(args) ⇒ Object
Methods inherited from BaseCommand
#add_format_option, #add_option, #error, #log, #output_format, #parse_dates, #parse_opts, #pop_arg, #pprint, #usage
Constructor Details
#initialize ⇒ PPrintCommand
Returns a new instance of PPrintCommand.
3 4 5 6 |
# File 'lib/gridcli/commands/pprint.rb', line 3 def initialize super "pprint", "A program that will pretty print posts/users" add_format_option end |
Instance Method Details
#run(args) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/gridcli/commands/pprint.rb', line 8 def run(args) parse_opts args ARGV.clear ARGF.each { |line| pprint(line) } end |