Class: Naplug::Helpers::ENGraphite::Metric
- Inherits:
-
Object
- Object
- Naplug::Helpers::ENGraphite::Metric
- Defined in:
- lib/naplug/helpers.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(path, value, time = Time.now) ⇒ Metric
constructor
A new instance of Metric.
- #to_s ⇒ Object
Constructor Details
#initialize(path, value, time = Time.now) ⇒ Metric
Returns a new instance of Metric.
80 81 82 83 84 |
# File 'lib/naplug/helpers.rb', line 80 def initialize(path,value,time = Time.now) @path = path @value = value @time = time end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
78 79 80 |
# File 'lib/naplug/helpers.rb', line 78 def path @path end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
78 79 80 |
# File 'lib/naplug/helpers.rb', line 78 def time @time end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
78 79 80 |
# File 'lib/naplug/helpers.rb', line 78 def value @value end |
Instance Method Details
#to_s ⇒ Object
86 87 88 |
# File 'lib/naplug/helpers.rb', line 86 def to_s '%s %d %d' % [@path,@value,@time.to_i] end |