Skip to content

Commit

Permalink
Make :color=, :right= and :left= be public
Browse files Browse the repository at this point in the history
Who can understand 'protected methods' of Ruby in 5 minutes? :)
  • Loading branch information
Hiroshi Nakamura committed Mar 27, 2012
1 parent 8a9e6a9 commit e803e39
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions lib/rbtree_map.rb
@@ -1,7 +1,7 @@
class RBTreeMap
class RBTree
attr_reader :key, :value, :color
attr_reader :left, :right
attr_reader :key, :value
attr_accessor :color, :left, :right

def initialize(key, value)
@key, @value = key, value
Expand Down Expand Up @@ -87,18 +87,6 @@ def need_rebalance?
red? and (@right.red? or @left.red?)
end

def color=(color)
@color = color
end

def left=(left)
@left = left
end

def right=(right)
@right = right
end

def color_flip(other)
@color, other.color = other.color, @color
end
Expand Down

0 comments on commit e803e39

Please sign in to comment.