module Graph::Function

Constants

VERSION

Attributes

configuration[RW]

Public Class Methods

as_canvas(file = file_location('html')) click to toggle source
# File lib/graph/function.rb, line 39
def self.as_canvas(file = file_location('html'))
  self.configure do |config|
    config.terminal = 'canvas'
    config.output = file
  end
end
as_gif(file = file_location('gif')) click to toggle source
# File lib/graph/function.rb, line 32
def self.as_gif(file = file_location('gif'))
  self.configure do |config|
    config.terminal = 'gif'
    config.output = file
  end
end
configure() { |configuration| ... } click to toggle source
# File lib/graph/function.rb, line 21
def self.configure
  self.configuration ||= Configuration.new
  yield(configuration) if block_given?
end
file_location(ext) click to toggle source
# File lib/graph/function.rb, line 28
def self.file_location(ext)
  File.new("#{$0.slice(0..-4)}.#{ext}", 'w').path
end