Sha256: 994afd0f310b1f0f2ae8d1aa1050eaf99023264dd36a4a89963ae7c6bffe0d15

Contents?: true

Size: 282 Bytes

Versions: 6

Compression:

Stored size: 282 Bytes

Contents

module AmCharts
  class ChartBuilder
    class Function
      attr_reader :name, :body

      def initialize(name, body = nil)
        @name, @body = name, body
      end

      def to_json
        body.nil? ? name.to_s : "function #{name}() { #{body} }"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
amcharts.rb-3.11.2.17 lib/amcharts/chart_builder/function.rb
amcharts.rb-3.11.2.16 lib/amcharts/chart_builder/function.rb
amcharts.rb-3.11.2.14 lib/amcharts/chart_builder/function.rb
amcharts.rb-3.11.1.14 lib/amcharts/chart_builder/function.rb
amcharts.rb-3.4.8.0 lib/amcharts/chart_builder/function.rb
amcharts.rb-3.4.7.5 lib/amcharts/chart_builder/function.rb