Class: FnordMetric::PieWidget

Inherits:
Widget
  • Object
show all
Defined in:
lib/fnordmetric/widgets/pie_widget.rb

Instance Attribute Summary

Attributes inherited from Widget

#gauges, #tick

Instance Method Summary collapse

Methods inherited from Widget

#add_gauges, #default_range, #ensure_has_tick!, #error!, #include_current?, #initialize, #range, #render, #ticks, #title, #token

Constructor Details

This class inherits a constructor from FnordMetric::Widget

Instance Method Details

#dataObject



3
4
5
6
7
8
9
# File 'lib/fnordmetric/widgets/pie_widget.rb', line 3

def data
  super.merge(
    :gauges => gauges.map(&:name),
    :gauge_titles => gauge_titles,
    :autoupdate => (@opts[:autoupdate] || 60)
  )
end

#gauge_titlesObject



11
12
13
14
15
16
17
# File 'lib/fnordmetric/widgets/pie_widget.rb', line 11

def gauge_titles
  {}.tap do |_hash|
    gauges.each do |gauge|
      _hash.merge!(gauge.name => gauge.title)
    end
  end
end

#has_tick?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/fnordmetric/widgets/pie_widget.rb', line 19

def has_tick?
  false
end