Permalink
Browse files

Documents Bracket#replace

  • Loading branch information...
1 parent ca2a22e commit a0be1a97d9b4cbfe16274e95dd203f5e95e4205a @cadwallion cadwallion committed May 22, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/bracket_tree/bracket.rb
@@ -39,6 +39,12 @@ def add position, data
end
end
+ # Replaces the data at a given node position with new payload. This is useful
+ # for updating bracket data, replacing placeholders with actual data, seeding,
+ # etc..
+ #
+ # @param [Fixnum] position - the node position to replace
+ # @param payload - the new payload object to replace
def replace position, payload
node = find { |n| n.position == position }
if node

0 comments on commit a0be1a9

Please sign in to comment.