Class: Gloo::Core::Heap
- Inherits:
-
Object
- Object
- Gloo::Core::Heap
- Defined in:
- lib/gloo/core/heap.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
The context is a reference to an object, usually a container.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#it ⇒ Object
readonly
Returns the value of attribute it.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
-
#error? ⇒ Boolean
Is there one or more errors?.
-
#initialize ⇒ Heap
constructor
Set up the object heap.
-
#unload(obj) ⇒ Object
Unload the given obj–remove it from the heap.
Constructor Details
Instance Attribute Details
#context ⇒ Object (readonly)
The context is a reference to an object, usually a container. The context will be the root by default.
15 16 17 |
# File 'lib/gloo/core/heap.rb', line 15 def context @context end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
17 18 19 |
# File 'lib/gloo/core/heap.rb', line 17 def error @error end |
#it ⇒ Object (readonly)
Returns the value of attribute it.
17 18 19 |
# File 'lib/gloo/core/heap.rb', line 17 def it @it end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
17 18 19 |
# File 'lib/gloo/core/heap.rb', line 17 def root @root end |
Instance Method Details
#error? ⇒ Boolean
Is there one or more errors?
46 47 48 |
# File 'lib/gloo/core/heap.rb', line 46 def error? return @error.error_count.positive? end |
#unload(obj) ⇒ Object
Unload the given obj–remove it from the heap.
36 37 38 39 40 41 |
# File 'lib/gloo/core/heap.rb', line 36 def unload( obj ) can = obj.parent.nil? ? @root : obj.parent return unless can can.remove_child obj end |