Class: Charty::RenderContext::Configurator

Inherits:
Object
  • Object
show all
Defined in:
lib/charty/plotter.rb

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Configurator

Returns a new instance of Configurator.



177
178
179
180
# File 'lib/charty/plotter.rb', line 177

def initialize(**args)
  @args = args
  @series = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



222
223
224
225
226
227
228
# File 'lib/charty/plotter.rb', line 222

def method_missing(method, *args)
  if (@args.has_key?(method))
    @args[name]
  else
    super
  end
end

Instance Method Details

#data(data) ⇒ Object



186
187
188
# File 'lib/charty/plotter.rb', line 186

def data(data)
  @data = data
end

#function(&block) ⇒ Object



182
183
184
# File 'lib/charty/plotter.rb', line 182

def function(&block)
  @function = block
end

#label(x, y) ⇒ Object



206
207
208
# File 'lib/charty/plotter.rb', line 206

def label(x, y)

end

#labels(labels) ⇒ Object



202
203
204
# File 'lib/charty/plotter.rb', line 202

def labels(labels)
  @labels = labels
end

#range(range) ⇒ Object



214
215
216
# File 'lib/charty/plotter.rb', line 214

def range(range)
  @range = range
end

#series(xs, ys = nil, zs = nil, xerr: nil, yerr: nil, label: nil) ⇒ Object



210
211
212
# File 'lib/charty/plotter.rb', line 210

def series(xs, ys=nil, zs=nil, xerr: nil, yerr: nil, label: nil)
  @series << Series.new(xs, ys, zs, xerr, yerr, label)
end

#title(title) ⇒ Object



190
191
192
# File 'lib/charty/plotter.rb', line 190

def title(title)
  @title = title
end

#to_aObject



218
219
220
# File 'lib/charty/plotter.rb', line 218

def to_a
  [@range, @series, @function, @data, @title, @xlabel, @ylabel, @labels]
end

#xlabel(xlabel) ⇒ Object



194
195
196
# File 'lib/charty/plotter.rb', line 194

def xlabel(xlabel)
  @xlabel = xlabel
end

#ylabel(ylabel) ⇒ Object



198
199
200
# File 'lib/charty/plotter.rb', line 198

def ylabel(ylabel)
  @ylabel = ylabel
end