Module: Asciidoctor::Chart::ChartBlockTracker

Defined in:
lib/asciidoctor/chart/chart_block.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#x_chartObject (readonly)

Returns the value of attribute x_chart.



23
24
25
# File 'lib/asciidoctor/chart/chart_block.rb', line 23

def x_chart
  @x_chart
end

Class Method Details

.extended(instance) ⇒ Object



25
26
27
28
29
# File 'lib/asciidoctor/chart/chart_block.rb', line 25

def self.extended instance
  instance.instance_variable_set :@x_chart, {
    engines: Set.new
  }
end

Instance Method Details

#get_engine(attrs) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/asciidoctor/chart/chart_block.rb', line 31

def get_engine attrs
  engine = if attrs.key? 'engine'
             attrs['engine'].downcase
           elsif @attributes.key? 'chart-engine'
             @attributes['chart-engine'].downcase
           else
             'c3js'
           end
  @x_chart[:engines].add(engine)

  engine
end