Class: BSON::Vector
- Inherits:
-
Array
- Object
- Array
- BSON::Vector
- Defined in:
- lib/bson/vector.rb
Overview
Vector of numbers along with metadata for binary interoperability.
Instance Attribute Summary collapse
-
#dtype ⇒ Integer
readonly
The data type stored in the vector.
-
#padding ⇒ Integer
readonly
be ignored when a vector element’s size is less than a byte and the length of the vector is not a multiple of 8.
Instance Method Summary collapse
-
#data ⇒ BSON::ByteBuffer
The data in the vector.
-
#initialize(data, dtype, padding = 0) ⇒ Vector
constructor
be ignored when a vector element’s size is less than a byte and the length of the vector is not a multiple of 8.
Constructor Details
#initialize(data, dtype, padding = 0) ⇒ Vector
be ignored when a vector element’s size is less than a byte and the length of the vector is not a multiple of 8.
38 39 40 41 42 |
# File 'lib/bson/vector.rb', line 38 def initialize(data, dtype, padding = 0) @dtype = dtype @padding = padding super(data.dup) end |
Instance Attribute Details
#dtype ⇒ Integer (readonly)
Returns The data type stored in the vector.
21 22 23 |
# File 'lib/bson/vector.rb', line 21 def dtype @dtype end |
#padding ⇒ Integer (readonly)
be ignored when a vector element’s size is less than a byte and the length of the vector is not a multiple of 8.
26 27 28 |
# File 'lib/bson/vector.rb', line 26 def padding @padding end |
Instance Method Details
#data ⇒ BSON::ByteBuffer
Returns The data in the vector.
29 30 31 |
# File 'lib/bson/vector.rb', line 29 def data self end |