Class: SimpleOutput::SimpleOutputEngine
- Inherits:
-
Object
- Object
- SimpleOutput::SimpleOutputEngine
- Defined in:
- lib/simpleoutput.rb
Instance Method Summary collapse
- #add_plugin(plugin) ⇒ Object
- #annotate(annotation, name = nil, options = {}) ⇒ Object
- #append_array(data = [], name = nil, options = {}) ⇒ Object
- #append_hash(hash = {}, name = nil, options = {}) ⇒ Object
- #append_points(points = [], name = nil, options = {}) ⇒ Object
-
#append_xy(x = [], y = [], name = nil, options = {}) ⇒ Object
Accept either [[x,y],] Hash [name] = y array [x,y ] Interface Functions.
- #append_xy_array(data = [], name = nil, options = {}) ⇒ Object
-
#initialize ⇒ SimpleOutputEngine
constructor
A new instance of SimpleOutputEngine.
- #save ⇒ Object
- #set_array(data = [], name = nil, options = {}) ⇒ Object
- #set_hash(hash = {}, name = nil, options = {}) ⇒ Object
- #set_points(points = [], name = nil, options = {}) ⇒ Object
- #set_xy(x = [], y = [], name = nil, options = {}) ⇒ Object
- #set_xy_array(data = [], name = nil, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ SimpleOutputEngine
Returns a new instance of SimpleOutputEngine.
245 246 247 248 |
# File 'lib/simpleoutput.rb', line 245 def initialize() @plugins = [] @data_id = 0 end |
Instance Method Details
#add_plugin(plugin) ⇒ Object
250 251 252 |
# File 'lib/simpleoutput.rb', line 250 def add_plugin(plugin) @plugins << plugin end |
#annotate(annotation, name = nil, options = {}) ⇒ Object
304 305 306 |
# File 'lib/simpleoutput.rb', line 304 def annotate(annotation, name=nil, ={}) @plugins.each {|plugin| plugin.annotate(annotation.clone, name, )} end |
#append_array(data = [], name = nil, options = {}) ⇒ Object
297 298 299 300 301 302 |
# File 'lib/simpleoutput.rb', line 297 def append_array(data = [], name=nil, ={}) x = [] data.count.times {|i| x << i} y = data.clone self.append_xy(x,y,name,) end |
#append_hash(hash = {}, name = nil, options = {}) ⇒ Object
282 283 284 |
# File 'lib/simpleoutput.rb', line 282 def append_hash(hash = {}, name=nil, ={}) @plugins.each {|plugin| plugin.append_hash(hash.clone,name, )} end |
#append_points(points = [], name = nil, options = {}) ⇒ Object
274 275 276 |
# File 'lib/simpleoutput.rb', line 274 def append_points(points =[], name=nil, ={}) @plugins.each {|plugin| plugin.append_points(points.clone,name, )} end |
#append_xy(x = [], y = [], name = nil, options = {}) ⇒ Object
Accept either [[x,y],] Hash [name] = y array [x,y ] Interface Functions
258 259 260 |
# File 'lib/simpleoutput.rb', line 258 def append_xy( x=[], y=[],name=nil, ={}) @plugins.each {|plugin| plugin.append_xy(x.clone,y.clone,name, )} end |
#append_xy_array(data = [], name = nil, options = {}) ⇒ Object
262 263 264 |
# File 'lib/simpleoutput.rb', line 262 def append_xy_array(data=[], name=nil, ={}) @plugins.each {|plugin| plugin.append_xy(data[0].clone,data[1].clone,name, )} end |
#save ⇒ Object
308 309 310 |
# File 'lib/simpleoutput.rb', line 308 def save() @plugins.each {|plugin| plugin.save()} end |
#set_array(data = [], name = nil, options = {}) ⇒ Object
290 291 292 293 294 295 |
# File 'lib/simpleoutput.rb', line 290 def set_array(data = [], name=nil, ={}) x = [] data.count.times {|i| x << i} y = data self.set_xy(x,y,name,) end |
#set_hash(hash = {}, name = nil, options = {}) ⇒ Object
286 287 288 |
# File 'lib/simpleoutput.rb', line 286 def set_hash(hash ={}, name=nil, ={}) @plugins.each {|plugin| plugin.set_hash(hash.clone,name, )} end |
#set_points(points = [], name = nil, options = {}) ⇒ Object
278 279 280 |
# File 'lib/simpleoutput.rb', line 278 def set_points(points = [], name=nil, ={}) @plugins.each {|plugin| plugin.set_points(points.clone,name, )} end |
#set_xy(x = [], y = [], name = nil, options = {}) ⇒ Object
270 271 272 |
# File 'lib/simpleoutput.rb', line 270 def set_xy(x=[], y=[], name=nil, ={}) @plugins.each {|plugin| plugin.set_xy(x.clone,y.clone,name, )} end |
#set_xy_array(data = [], name = nil, options = {}) ⇒ Object
266 267 268 |
# File 'lib/simpleoutput.rb', line 266 def set_xy_array(data = [], name=nil, ={}) @plugins.each {|plugin| plugin.set_xy(data[0].clone,data[1].clone, name, )} end |