class MyChart::Dsl::Draw::ChartCmdARGV

Attributes

opt[R]
x[R]
y[R]

Public Class Methods

new(*arg) click to toggle source
# File lib/my_chart/dsl/draw.rb, line 49
def initialize *arg
  return if arg.empty?
  @opt = (arg[-1].kind_of? Hash) ? arg[-1] : {}
  @x = arg[0] if arg[0].kind_of? Symbol
  @y = arg[1] if arg[1] and arg[1].kind_of? Symbol
end

Public Instance Methods

data_id() click to toggle source
# File lib/my_chart/dsl/draw.rb, line 71
def data_id
  [x,
   y ? y : "no_y",
   keys ? "keys_#{keys.hash}" : "no_keys",
   from ? "from_#{from}" : "from_all",
   sort,
   limit
  ].compact.join '__'
end
limit() click to toggle source
# File lib/my_chart/dsl/draw.rb, line 66
def limit
  lm = (first and :first) or (last and :last)
  [lm, (first or last)].join('_') if lm
end
method_missing(name, *arg) click to toggle source
Calls superclass method
# File lib/my_chart/dsl/draw.rb, line 56
def method_missing name, *arg
  return opt[name] if [:w, :h, :name, :from, :keys, :asc, :desc, :first, :last].include? name
  super
end
sort() click to toggle source
# File lib/my_chart/dsl/draw.rb, line 61
def sort
  order = (asc and :asc) or (desc and :desc)
  [order, 'by', (asc or desc)].join('_') if order
end