Class: Charty::Plotters::BaseMapper

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

Direct Known Subclasses

ColorMapper, SizeMapper, StyleMapper

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plotter, *params) ⇒ BaseMapper

Returns a new instance of BaseMapper.



4
5
6
7
# File 'lib/charty/plotters/relational_plotter.rb', line 4

def initialize(plotter, *params)
  @plotter = plotter
  initialize_mapping(*params)
end

Instance Attribute Details

#plotterObject (readonly)

Returns the value of attribute plotter.



9
10
11
# File 'lib/charty/plotters/relational_plotter.rb', line 9

def plotter
  @plotter
end

Instance Method Details

#[](key, *args) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/charty/plotters/relational_plotter.rb', line 11

def [](key, *args)
  case key
  when Array, Charty::Vector
    key.map {|k| lookup_single_value(k, *args) }
  else
    lookup_single_value(key, *args)
  end
end