Method: Plotrb::Scale#initialize

Defined in:
lib/plotrb/scales.rb

#initialize(type = :linear, &block) ⇒ Scale



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/plotrb/scales.rb', line 28

def initialize(type=:linear, &block)
  @type = type
  case @type
    when :ordinal
      set_ordinal_scale_attributes
    when :time, :utc
      set_time_scale_attributes
    else
      set_quantitative_scale_attributes
  end
  set_common_scale_attributes
  ::Plotrb::Kernel.scales << self
  self.instance_eval(&block) if block_given?
  self
end