class ChartJS::SaveFile

Public Class Methods

new(path, html: false) click to toggle source
# File lib/chart_js/chart/bar_chart/file.rb, line 7
def initialize(path, html: false)
  path(path)
  @html = html if html
end

Public Instance Methods

path(value = nil) click to toggle source
# File lib/chart_js/chart/bar_chart/file.rb, line 12
def path(value = nil)
  return @path if value.nil?
  @path = value
end
save!(path: @path, html: @html) click to toggle source
# File lib/chart_js/chart/bar_chart/file.rb, line 17
def save!(path: @path, html: @html)
  File.open(path, "w") do |file|
    file.write(html)
    file.close
  end
end