Class: Nokogiri::WeakBucket

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/nokogiri/ffi/weak_bucket.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWeakBucket

Returns a new instance of WeakBucket.



17
18
19
# File 'lib/nokogiri/ffi/weak_bucket.rb', line 17

def initialize
  @bucket = Weakling::IdHash.new
end

Instance Attribute Details

#bucketObject

Returns the value of attribute bucket.



15
16
17
# File 'lib/nokogiri/ffi/weak_bucket.rb', line 15

def bucket
  @bucket
end

Class Method Details

.get_object(cstruct) ⇒ Object



21
22
23
# File 'lib/nokogiri/ffi/weak_bucket.rb', line 21

def WeakBucket.get_object(cstruct)
  instance.bucket[cstruct.ruby_node_pointer]
end

.set_object(cstruct, object) ⇒ Object



25
26
27
# File 'lib/nokogiri/ffi/weak_bucket.rb', line 25

def WeakBucket.set_object(cstruct, object)
  cstruct.ruby_node_pointer = instance.bucket.add(object)
end