Class: Plotty::Command::Top

Inherits:
Samovar::Command
  • Object
show all
Defined in:
lib/plotty/command.rb

Instance Method Summary collapse

Instance Method Details

#call(program_name: File.basename($0)) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/plotty/command.rb', line 48

def call(program_name: File.basename($0))
	if @options[:version]
		puts "plotty v#{Teapot::VERSION}"
	elsif @options[:help] or @command.nil?
		print_usage(program_name)
	else
		plot_graph
	end
end

#plot_graphObject



44
45
46
# File 'lib/plotty/command.rb', line 44

def plot_graph
	Graph.parse(options[:x], options[:y], @command).plot!(options[:script], options[:name])
end