Class: Aerospike::StringValue
- Inherits:
-
Value
- Object
- Value
- Aerospike::StringValue
show all
- Defined in:
- lib/aerospike/value/value.rb
Overview
Instance Method Summary
collapse
Methods inherited from Value
get_packer, of, put_packer
Constructor Details
157
158
159
160
|
# File 'lib/aerospike/value/value.rb', line 157
def initialize(val)
@value = val || ''
self
end
|
Instance Method Details
#estimate_size ⇒ Object
162
163
164
|
# File 'lib/aerospike/value/value.rb', line 162
def estimate_size
@value.bytesize
end
|
#get ⇒ Object
178
179
180
|
# File 'lib/aerospike/value/value.rb', line 178
def get
@value
end
|
#pack(packer) ⇒ Object
170
171
172
|
# File 'lib/aerospike/value/value.rb', line 170
def pack(packer)
packer.write(Aerospike::ParticleType::STRING.chr + @value)
end
|
#to_bytes ⇒ Object
182
183
184
|
# File 'lib/aerospike/value/value.rb', line 182
def to_bytes
@value
end
|
#to_s ⇒ Object
186
187
188
|
# File 'lib/aerospike/value/value.rb', line 186
def to_s
@value
end
|
#to_sym ⇒ Object
190
191
192
|
# File 'lib/aerospike/value/value.rb', line 190
def to_sym
@value.to_sym
end
|
#write(buffer, offset) ⇒ Object
166
167
168
|
# File 'lib/aerospike/value/value.rb', line 166
def write(buffer, offset)
buffer.write_binary(@value, offset)
end
|