Class: Aerospike::Bin

Inherits:
Object
  • Object
show all
Defined in:
lib/aerospike/bin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bin_name, bin_value) ⇒ Bin

Returns a new instance of Bin.



23
24
25
26
# File 'lib/aerospike/bin.rb', line 23

def initialize(bin_name, bin_value)
  @name = bin_name
  @value = Value.of(bin_value)
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



21
22
23
# File 'lib/aerospike/bin.rb', line 21

def name
  @name
end

Instance Method Details

#to_sObject



44
45
46
# File 'lib/aerospike/bin.rb', line 44

def to_s
  "#{@name}:#{@value.to_s}"
end

#typeObject



40
41
42
# File 'lib/aerospike/bin.rb', line 40

def type
  @value.type if @value
end

#valueObject



32
33
34
# File 'lib/aerospike/bin.rb', line 32

def value
  @value.get if @value
end

#value=(val) ⇒ Object



28
29
30
# File 'lib/aerospike/bin.rb', line 28

def value=(val)
  @value = Value.of(val)
end

#value_objectObject



36
37
38
# File 'lib/aerospike/bin.rb', line 36

def value_object
  @value
end