Class: Minichart::VerticalStatusLeds

Inherits:
Leds
  • Object
show all
Defined in:
lib/minichart/leds/vertical_status_leds.rb

Instance Attribute Summary

Attributes inherited from Base

#data, #options

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Leds

leds_defaults

Methods inherited from Base

#full_height, #full_width, #initialize, master_defaults, options, #setup_clip_path, #viewbox

Constructor Details

This class inherits a constructor from Minichart::Base

Class Method Details

.defaultsObject



4
5
6
# File 'lib/minichart/leds/vertical_status_leds.rb', line 4

def defaults
  leds_defaults.merge width: 50, height: 300
end

Instance Method Details

#buildObject



9
10
11
12
13
# File 'lib/minichart/leds/vertical_status_leds.rb', line 9

def build
  data.each_with_index do |value, i|
    element :rect, bar_options(value, i)
  end
end