Sha256: 83abc99072da63948d881a58d810f3f0878af320e4e2b03d3ad6d7786449043e
Contents?: true
Size: 534 Bytes
Versions: 17
Compression:
Stored size: 534 Bytes
Contents
class FnordMetric::Dashboard attr_accessor :widgets def initialize(options={}) raise "please provide a :title" unless options[:title] @widgets = Array.new @options = options end def add_widget(w) @widgets << w end def title @options[:title] end def token title.to_s.gsub(/[\W]/, '') end def to_json { :title => title, :widgets => {}.tap { |wids| @widgets.each do |w| wids[w.token] = w.render end } }.to_json end end
Version data entries
17 entries across 17 versions & 1 rubygems