Class: Google::Cloud::Bigtable::Row::Cell
- Inherits:
-
Object
- Object
- Google::Cloud::Bigtable::Row::Cell
- Defined in:
- lib/google/cloud/bigtable/row.rb
Overview
Cell
Row cell built from data chunks.
Instance Attribute Summary collapse
-
#family ⇒ Object
readonly
Returns the value of attribute family.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#qualifier ⇒ Object
readonly
Returns the value of attribute qualifier.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(family, qualifier, timestamp, value, labels = []) ⇒ Cell
constructor
Creates a row cell instance.
-
#to_i ⇒ Integer
Converts a value to an integer.
-
#to_time(granularity = nil) ⇒ Time | nil
Converts timestamp to Time instance.
Constructor Details
#initialize(family, qualifier, timestamp, value, labels = []) ⇒ Cell
Creates a row cell instance.
48 49 50 51 52 53 54 |
# File 'lib/google/cloud/bigtable/row.rb', line 48 def initialize family, qualifier, , value, labels = [] @family = family @qualifier = qualifier @timestamp = @value = value @labels = labels end |
Instance Attribute Details
#family ⇒ Object (readonly)
Returns the value of attribute family.
33 34 35 |
# File 'lib/google/cloud/bigtable/row.rb', line 33 def family @family end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
36 37 38 |
# File 'lib/google/cloud/bigtable/row.rb', line 36 def labels @labels end |
#qualifier ⇒ Object (readonly)
Returns the value of attribute qualifier.
34 35 36 |
# File 'lib/google/cloud/bigtable/row.rb', line 34 def qualifier @qualifier end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
37 38 39 |
# File 'lib/google/cloud/bigtable/row.rb', line 37 def @timestamp end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
35 36 37 |
# File 'lib/google/cloud/bigtable/row.rb', line 35 def value @value end |
Instance Method Details
#to_i ⇒ Integer
Converts a value to an integer.
75 76 77 |
# File 'lib/google/cloud/bigtable/row.rb', line 75 def to_i @value.unpack1 "q>" end |
#to_time(granularity = nil) ⇒ Time | nil
Converts timestamp to Time instance.
64 65 66 67 68 |
# File 'lib/google/cloud/bigtable/row.rb', line 64 def to_time granularity = nil return nil if @timestamp.zero? return Time.at @timestamp / 1_000_000.0 if granularity == :micros Time.at @timestamp / 1000.0 end |