Class: Metric
- Inherits:
-
Object
show all
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/metrics/metric.rb,
lib/storage/metric_mongo.rb
Instance Method Summary
collapse
Instance Method Details
#convert(value) ⇒ Object
20
21
22
|
# File 'lib/metrics/metric.rb', line 20
def convert value
value
end
|
#edit(value, user) ⇒ Object
3
4
5
6
|
# File 'lib/metrics/metric.rb', line 3
def edit value, user
values << PropertyValue.new(value: convert(value), created_by: user)
self
end
|
#last_updated_at ⇒ Object
16
17
18
|
# File 'lib/metrics/metric.rb', line 16
def last_updated_at
values.last.try :created_at
end
|
#last_updated_by ⇒ Object
12
13
14
|
# File 'lib/metrics/metric.rb', line 12
def last_updated_by
values.last.try :created_by
end
|
#last_value ⇒ Object
8
9
10
|
# File 'lib/metrics/metric.rb', line 8
def last_value
values.last.try :value
end
|