Class: Nokogiri::WeakBucket
- Inherits:
-
Object
- Object
- Nokogiri::WeakBucket
- Includes:
- Singleton
- Defined in:
- lib/nokogiri/ffi/weak_bucket.rb
Instance Attribute Summary collapse
-
#bucket ⇒ Object
Returns the value of attribute bucket.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ WeakBucket
constructor
A new instance of WeakBucket.
Constructor Details
#initialize ⇒ WeakBucket
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
#bucket ⇒ Object
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 |