Class: Jylis::DataType::TLOG::Row
- Inherits:
-
Object
- Object
- Jylis::DataType::TLOG::Row
- Defined in:
- lib/jylis-rb/data_types/tlog.rb
Overview
A row (data point) in a TLOG::Result.
Instance Attribute Summary collapse
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
-
.parse(query_row) ⇒ Jylis::DataType::TLOG::Row
Construct a Row from a raw query row.
Instance Method Summary collapse
-
#==(other) ⇒ Object
:nodoc:.
-
#initialize(value, timestamp) ⇒ Row
constructor
A new instance of Row.
-
#time ⇒ Time
The timestamp as a Time object.
-
#timestamp_iso8601 ⇒ String
The timestamp as an ISO8601 formatted string.
-
#to_a ⇒ Object
Reconstruct the raw result returned by the database.
Constructor Details
#initialize(value, timestamp) ⇒ Row
Returns a new instance of Row.
64 65 66 67 |
# File 'lib/jylis-rb/data_types/tlog.rb', line 64 def initialize(value, ) @value = value @timestamp = end |
Instance Attribute Details
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
53 54 55 |
# File 'lib/jylis-rb/data_types/tlog.rb', line 53 def @timestamp end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
52 53 54 |
# File 'lib/jylis-rb/data_types/tlog.rb', line 52 def value @value end |
Class Method Details
.parse(query_row) ⇒ Jylis::DataType::TLOG::Row
Construct a Row from a raw query row.
60 61 62 |
# File 'lib/jylis-rb/data_types/tlog.rb', line 60 def self.parse(query_row) new(query_row[0], query_row[1]) end |
Instance Method Details
#==(other) ⇒ Object
:nodoc:
70 71 72 73 |
# File 'lib/jylis-rb/data_types/tlog.rb', line 70 def ==(other) other.value == self.value && other. == self. end |
#time ⇒ Time
Returns the timestamp as a Time object.
81 82 83 |
# File 'lib/jylis-rb/data_types/tlog.rb', line 81 def time Time.at() end |
#timestamp_iso8601 ⇒ String
Returns the timestamp as an ISO8601 formatted string.
86 87 88 |
# File 'lib/jylis-rb/data_types/tlog.rb', line 86 def time.utc.iso8601 end |
#to_a ⇒ Object
Reconstruct the raw result returned by the database.
76 77 78 |
# File 'lib/jylis-rb/data_types/tlog.rb', line 76 def to_a [value, ] end |