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.
274 275 276 277 278 279 280 |
# File 'lib/ofc2.rb', line 274 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: <<
282 283 284 |
# File 'lib/ofc2.rb', line 282 def add_element( e ) @elements << e end |
#render ⇒ Object
287 288 289 290 291 292 293 294 |
# File 'lib/ofc2.rb', line 287 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 |