Class: RedPlot::ToDraw
- Inherits:
-
Object
- Object
- RedPlot::ToDraw
- Defined in:
- lib/redplot.rb
Overview
helper class to store callbacks to the data and plot command options
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#add(option = "", &block) ⇒ Object
main client method expects a callback block that return an object with access to data to plat different object are possible (cf Plotter#formatdata).
-
#initialize ⇒ ToDraw
constructor
A new instance of ToDraw.
- #reinit ⇒ Object (also: #clear)
Constructor Details
#initialize ⇒ ToDraw
Returns a new instance of ToDraw.
44 45 46 |
# File 'lib/redplot.rb', line 44 def initialize reinit end |
Instance Attribute Details
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
43 44 45 |
# File 'lib/redplot.rb', line 43 def callbacks @callbacks end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
43 44 45 |
# File 'lib/redplot.rb', line 43 def @options end |
Instance Method Details
#add(option = "", &block) ⇒ Object
main client method expects a callback block that return an object with access to data to plat different object are possible (cf Plotter#formatdata)
54 55 56 57 58 59 60 |
# File 'lib/redplot.rb', line 54 def add(option="", &block) unless block.nil? @options << option @callbacks << block end self end |
#reinit ⇒ Object Also known as: clear
47 48 49 50 |
# File 'lib/redplot.rb', line 47 def reinit @options, @callbacks = [], [] self end |