lib/simple_metrics/instrument.rb in simple_metrics-0.4.2 vs lib/simple_metrics/instrument.rb in simple_metrics-0.4.3
- old
+ new
@@ -1,21 +1,23 @@
module SimpleMetrics
class Instrument
- attr_accessor :id, :name, :metrics, :created_at, :updated_at
+ 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
\ No newline at end of file