Class: OFC2::Graph
Overview
title
+x_axis+
+y_axis+
+y_axis_right+
+x_legend+
+y_legend+
+bg_colour+
+elements+
Instance Method Summary collapse
- #add_element(e) ⇒ Object (also: #<<)
-
#initialize(opts = {}) ⇒ Graph
constructor
A new instance of Graph.
- #render ⇒ Object
Methods included from OWJSON
Constructor Details
#initialize(opts = {}) ⇒ Graph
Returns a new instance of Graph.
277 278 279 280 281 282 283 |
# File 'lib/ofc2.rb', line 277 def initialize(opts = {}) @title = Title.new(:text => "Graph" ) @elements = [] opts.each do |name, value| self.send("#{name}=", value) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class OFC2::OWJSON
Instance Method Details
#add_element(e) ⇒ Object Also known as: <<
285 286 287 |
# File 'lib/ofc2.rb', line 285 def add_element( e ) @elements << e end |
#render ⇒ Object
290 291 292 293 294 295 296 297 |
# File 'lib/ofc2.rb', line 290 def render s = to_json # about underscores s.gsub!('___','') # that is for @___3d variable s.gsub!('__','-') # that is for @smt__smt variables # variables @smt_smt should go without changes s end |