lib/highcharts/base.rb in highcharts-js-rails-0.0.1 vs lib/highcharts/base.rb in highcharts-js-rails-0.0.2
- old
+ new
@@ -1,19 +1,21 @@
+require 'action_view'
+
module Highcharts
class Base < ActionView::Base
-
+
def initialize(*args)
args.extract_options!.each {|arg, value| self.send("#{arg}=", value)}
end
-
+
def render_options(args)
attrs = []
args.each do |t, a|
a.split.each do |option|
attrs << "#{option}: #{t == :objects ? send(option) : "'#{send(option)}'"}" if send(option).present?
end
end
attrs
end
-
+
end
-end
\ No newline at end of file
+end