Class: GraphiteMetric::Plaintext
- Inherits:
-
Struct
- Object
- Struct
- GraphiteMetric::Plaintext
- Extended by:
- Util
- Defined in:
- lib/graphite-metric/plaintext.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Plaintext
constructor
A new instance of Plaintext.
- #to_s ⇒ Object
Methods included from Util
Constructor Details
#initialize(*args) ⇒ Plaintext
Returns a new instance of Plaintext.
7 8 9 10 |
# File 'lib/graphite-metric/plaintext.rb', line 7 def initialize(*args) super self[:timestamp] ||= Time.now.utc.to_i end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key
4 5 6 |
# File 'lib/graphite-metric/plaintext.rb', line 4 def key @key end |
#timestamp ⇒ Object
Returns the value of attribute timestamp
4 5 6 |
# File 'lib/graphite-metric/plaintext.rb', line 4 def @timestamp end |
#value ⇒ Object
Returns the value of attribute value
4 5 6 |
# File 'lib/graphite-metric/plaintext.rb', line 4 def value @value end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/graphite-metric/plaintext.rb', line 12 def to_s [key, value, ].join(" ") end |