class AmCharts::ChartBuilder::Function
Attributes
body[R]
name[R]
Public Class Methods
new(name, body = nil)
click to toggle source
# File lib/amcharts/chart_builder/function.rb, line 6 def initialize(name, body = nil) @name, @body = name, body end
Public Instance Methods
to_json()
click to toggle source
# File lib/amcharts/chart_builder/function.rb, line 10 def to_json body.nil? ? name.to_s : "function #{name}() { #{body} }" end