Class: FnordMetric::HtmlWidget

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

Instance Attribute Summary

Attributes inherited from Widget

#gauges, #tick

Instance Method Summary collapse

Methods inherited from Widget

#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

#add_gauges(gauges) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/fnordmetric/widgets/html_widget.rb', line 8

def add_gauges(gauges)
  @gauges = []
  @tick   = 0
  
  if !gauges.blank?
    error! "initializing a html widget with gauges is void"
  end
end

#dataObject



2
3
4
5
6
# File 'lib/fnordmetric/widgets/html_widget.rb', line 2

def data
  super.merge(
    :html => @opts[:html]
  )
end

#data_gaugesObject



17
18
19
# File 'lib/fnordmetric/widgets/html_widget.rb', line 17

def data_gauges
  {}
end

#default_range(now = Time.now) ⇒ Object



21
22
23
# File 'lib/fnordmetric/widgets/html_widget.rb', line 21

def default_range(now=Time.now)
  0..0
end

#has_tick?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/fnordmetric/widgets/html_widget.rb', line 25

def has_tick?
  false
end