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
161
162
163
164
|
# File 'lib/aerospike/value/value.rb', line 161
def initialize(val)
@value = val || ''
self
end
|
Instance Method Details
#estimate_size ⇒ Object
166
167
168
|
# File 'lib/aerospike/value/value.rb', line 166
def estimate_size
@value.bytesize
end
|
#get ⇒ Object
182
183
184
|
# File 'lib/aerospike/value/value.rb', line 182
def get
@value
end
|
#pack(packer) ⇒ Object
174
175
176
|
# File 'lib/aerospike/value/value.rb', line 174
def pack(packer)
packer.write(Aerospike::ParticleType::STRING.chr + @value)
end
|
#to_bytes ⇒ Object
186
187
188
|
# File 'lib/aerospike/value/value.rb', line 186
def to_bytes
@value
end
|
#to_s ⇒ Object
190
191
192
|
# File 'lib/aerospike/value/value.rb', line 190
def to_s
@value
end
|
#to_sym ⇒ Object
194
195
196
|
# File 'lib/aerospike/value/value.rb', line 194
def to_sym
@value.to_sym
end
|
#write(buffer, offset) ⇒ Object
170
171
172
|
# File 'lib/aerospike/value/value.rb', line 170
def write(buffer, offset)
buffer.write_binary(@value, offset)
end
|