Class: Sparkr::CLI
- Inherits:
-
Object
- Object
- Sparkr::CLI
- Defined in:
- lib/sparkr/cli.rb
Class Method Summary collapse
-
.run(*args) ⇒ CLI
Helper method to run an instance with the given
args
.
Instance Method Summary collapse
-
#run(*args) ⇒ void
Runs sparkr with the given
args
.
Class Method Details
.run(*args) ⇒ CLI
Helper method to run an instance with the given args
9 10 11 12 13 |
# File 'lib/sparkr/cli.rb', line 9 def self.run(*args) instance = new instance.run(*args) instance end |
Instance Method Details
#run(*args) ⇒ void
This method returns an undefined value.
Runs sparkr with the given args
17 18 19 20 21 22 23 24 |
# File 'lib/sparkr/cli.rb', line 17 def run(*args) if args.empty? || (args.size == 1 && %w(-h --help).include?(args.first)) puts help else sparkline = Sparkline.new(args.map(&:to_f)) puts sparkline.to_s end end |