Class: Harness::Measurement
- Inherits:
-
Object
- Object
- Harness::Measurement
- Defined in:
- lib/harness/measurement.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#source ⇒ Object
Returns the value of attribute source.
-
#time ⇒ Object
Returns the value of attribute time.
-
#units ⇒ Object
Returns the value of attribute units.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(attributes = {}) ⇒ Measurement
constructor
A new instance of Measurement.
- #log ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Measurement
Returns a new instance of Measurement.
5 6 7 8 9 10 11 |
# File 'lib/harness/measurement.rb', line 5 def initialize(attributes = {}) attributes.each_pair do |name, value| send "#{name}=", value end self.time ||= Time.now end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/harness/measurement.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/harness/measurement.rb', line 3 def name @name end |
#source ⇒ Object
Returns the value of attribute source.
3 4 5 |
# File 'lib/harness/measurement.rb', line 3 def source @source end |
#time ⇒ Object
Returns the value of attribute time.
3 4 5 |
# File 'lib/harness/measurement.rb', line 3 def time @time end |
#units ⇒ Object
Returns the value of attribute units.
3 4 5 |
# File 'lib/harness/measurement.rb', line 3 def units @units end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/harness/measurement.rb', line 3 def value @value end |
Instance Method Details
#attributes ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/harness/measurement.rb', line 27 def attributes { :id => id, :name => name, :source => source, :time => time, :units => units, :value => value } end |