Class: RailsCharts::Javascript
- Inherits:
-
Object
- Object
- RailsCharts::Javascript
- Defined in:
- lib/rails_charts/javascript.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
- #as_json(options = nil) ⇒ Object
-
#initialize(code) ⇒ Javascript
constructor
A new instance of Javascript.
Constructor Details
#initialize(code) ⇒ Javascript
Returns a new instance of Javascript.
5 6 7 |
# File 'lib/rails_charts/javascript.rb', line 5 def initialize(code) @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/rails_charts/javascript.rb', line 3 def code @code end |
Instance Method Details
#as_json(options = nil) ⇒ Object
9 10 11 |
# File 'lib/rails_charts/javascript.rb', line 9 def as_json( = nil) "RAILS_CHART_JS:#{Base64.strict_encode64(code)}:RAILS_CHART_JS_END" end |