Sha256: 7de7ba2ec3985a5f1f6c81962e55ba638fd4a31496d2de049aa5158c3c985d20

Contents?: true

Size: 690 Bytes

Versions: 4

Compression:

Stored size: 690 Bytes

Contents

module PulseMeter
  module DygraphsVisualize
    class Error < StandardError; end

    class Widget < Base
      def initialize(opts)
        super
        @opts[:sensors] ||= []
      end

      def data
        {
          type: type,
          title: title,
          redraw_interval: redraw_interval,
          width: width,
          dygraphs_options: dygraphs_options,
          values_title: values_label
        }
      end

      def type
        self.class.to_s.split('::').last.downcase
      end

      protected

      def gauge_series_data
        ensure_gauge_indicators!
        sensors.map do |s|
          [s.annotation, s.value]
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pulse_meter-dygraphs_visualizer-0.4.18 lib/pulse_meter/dygraphs_visualize/widget.rb
pulse_meter-dygraphs_visualizer-0.4.17 lib/pulse_meter/dygraphs_visualize/widget.rb
pulse_meter-dygraphs_visualizer-0.4.16 lib/pulse_meter/dygraphs_visualize/widget.rb
pulse_meter-dygraphs_visualizer-0.4.15 lib/pulse_meter/dygraphs_visualize/widget.rb