Sha256: 70124c9749a35a15bf23fb15800d967e3466dcd716ad0c5eff5359ff00f58e2a
Contents?: true
Size: 754 Bytes
Versions: 4
Compression:
Stored size: 754 Bytes
Contents
module SimpleMetrics class Instrument attr_accessor :id, :name, :metrics, :renderer, :created_at, :updated_at def initialize(attributes) @id = attributes[:id] @name = attributes[:name] @renderer = attributes[:renderer] || 'line' @created_at = attributes[:created_at] @updated_at = attributes[:updated_at] @metrics = attributes[:metrics] || [] end def attributes { :id => @id.to_s, # convert bson id to str :name => @name, :renderer => @renderer, :metrics => @metrics, :created_at => @created_at, :updated_at => @updated_at } end def to_s attributes.to_s end end end
Version data entries
4 entries across 4 versions & 1 rubygems