Sha256: 55fca7661f8df6e6c7967b99cd5e704bfb184ef8d1dab39a76e4a773230a0f32

Contents?: true

Size: 345 Bytes

Versions: 6

Compression:

Stored size: 345 Bytes

Contents

# frozen_string_literal: true

class RedBlackTree
  module Utils # @private
    private

    def opposite_direction direction
      case direction
      when "up" then "down"
      when "right" then "left"
      when "down" then "up"
      when "left" then "right"
      else raise ArgumentError, "Invalid direction"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
red-black-tree-0.1.5 lib/red_black_tree/utils.rb
red-black-tree-0.1.4 lib/red_black_tree/utils.rb
red-black-tree-0.1.3 lib/red_black_tree/utils.rb
red-black-tree-0.1.2 lib/red_black_tree/utils.rb
red-black-tree-0.1.1 lib/red_black_tree/utils.rb
red-black-tree-0.1.0 lib/red_black_tree/utils.rb