diff --git a/RedBlackTree.html b/RedBlackTree.html index 015cf6c..f33918f 100644 --- a/RedBlackTree.html +++ b/RedBlackTree.html @@ -95,7 +95,7 @@
Defined in:
lib/red-black-tree.rb,
- lib/red_black_tree/node.rb,
lib/red_black_tree/utils.rb,
lib/red_black_tree/version.rb,
lib/red_black_tree/node/leaf_node.rb,
lib/red_black_tree/node/leaf_node_comparable.rb,
lib/red_black_tree/node/left_right_element_referencers.rb
+ lib/red_black_tree/node.rb,
lib/red_black_tree/utils.rb,
lib/red_black_tree/version.rb,
lib/red_black_tree/node/leaf_node.rb,
lib/red_black_tree/node/data_delegation.rb,
lib/red_black_tree/node/leaf_node_comparable.rb,
lib/red_black_tree/node/left_right_element_referencers.rb
@@ -105,6 +105,8 @@

Defined Under Namespace

+ Modules: DataDelegation + Classes: Node @@ -1779,7 +1781,7 @@

diff --git a/RedBlackTree/DataDelegation.html b/RedBlackTree/DataDelegation.html new file mode 100644 index 0000000..8486752 --- /dev/null +++ b/RedBlackTree/DataDelegation.html @@ -0,0 +1,269 @@ + + + + + + + Module: RedBlackTree::DataDelegation + + — Documentation by YARD 0.9.36 + + + + + + + + + + + + + + + + + + + +
+ + +

Module: RedBlackTree::DataDelegation + + + +

+
+ + + + + + + + + +
+
Included in:
+
Node
+
+ + + +
+
Defined in:
+
lib/red_black_tree/node/data_delegation.rb
+
+ +
+ + + + + + + + + +

+ Instance Method Summary + collapse +

+ + + + +
+

Dynamic Method Handling

+

+ This class handles dynamic methods through the method_missing method + +

+ +
+

+ + #method_missing(method_name, *args, &block) ⇒ Object + + + + + +

+ + + + +
+
+
+
+5
+6
+7
+8
+9
+10
+11
+
+
# File 'lib/red_black_tree/node/data_delegation.rb', line 5
+
+def method_missing(method_name, *args, &block)
+  if @data.respond_to?(method_name)
+    @data.public_send(method_name, *args, &block)
+  else
+    super
+  end
+end
+
+
+ +
+ + +
+

Instance Method Details

+ + +
+

+ + #respond_to_missing?(method_name, include_private = false) ⇒ Boolean + + + + + +

+
+ + +
+
+
+ +

Returns:

+
    + +
  • + + + (Boolean) + + + +
  • + +
+ +
+ + + + +
+
+
+
+13
+14
+15
+
+
# File 'lib/red_black_tree/node/data_delegation.rb', line 13
+
+def respond_to_missing?(method_name, include_private = false)
+  @data.respond_to?(method_name, include_private) || super
+end
+
+
+ +
+ +
+ + + +
+ + \ No newline at end of file diff --git a/RedBlackTree/Node.html b/RedBlackTree/Node.html index 48ccbbe..ac89b00 100644 --- a/RedBlackTree/Node.html +++ b/RedBlackTree/Node.html @@ -89,7 +89,7 @@
Includes:
-
Comparable
+
Comparable, DataDelegation
@@ -227,6 +227,17 @@

+ + + + + + + + +

Methods included from DataDelegation

+

#method_missing, #respond_to_missing?

+

Constructor Details

@@ -289,18 +300,18 @@

 
 
-22
-23
 24
 25
 26
 27
 28
 29
-30
+30 +31 +32 -
# File 'lib/red_black_tree/node.rb', line 22
+      
# File 'lib/red_black_tree/node.rb', line 24
 
 def initialize data
   raise ArgumentError, "data cannot be nil" if data.nil? && !(instance_of? RedBlackTree::LeafNode)
@@ -316,6 +327,16 @@ 

+ +
+

Dynamic Method Handling

+

+ This class handles dynamic methods through the method_missing method + + in the class RedBlackTree::DataDelegation + +

+
@@ -367,12 +388,12 @@

 
 
-18
-19
-20
+20 +21 +22 -
# File 'lib/red_black_tree/node.rb', line 18
+      
# File 'lib/red_black_tree/node.rb', line 20
 
 def data
   @data
@@ -428,12 +449,12 @@ 

 
 
-35
-36
-37
+37 +38 +39

-
# File 'lib/red_black_tree/node.rb', line 35
+      
# File 'lib/red_black_tree/node.rb', line 37
 
 def <=> other
   raise NotImplementedError, "Comparable operator <=> must be implemented in subclass"
@@ -448,7 +469,7 @@ 

diff --git a/_index.html b/_index.html index 4307208..abaf24b 100644 --- a/_index.html +++ b/_index.html @@ -76,6 +76,21 @@

Namespace Listing A-Z

+ + +