Permalink
Browse files

Renames nodes to matches

  • Loading branch information...
1 parent bc2e517 commit e4170ff83c2983267a36cb6bce6ac1fb552af25c @cadwallion cadwallion committed May 23, 2012
@@ -8,8 +8,10 @@ class SeedLimitExceededError < Exception ; end
include Enumerable
attr_accessor :root, :seed_order, :insertion_order
- def initialize
+ def initialize options = {}
@insertion_order = []
+
+ @matches = options[:matches] || []
end
# Adds a Node at the given position, setting the data as the payload. Maps to
@@ -31,8 +31,8 @@ def from_json json
template.starting_seats = json['startingSeats']
end
- if json['nodes']
- template.nodes = json['nodes']
+ if json['matches']
+ template.matches = json['matches']
end
template
@@ -45,12 +45,12 @@ def location
end
end
- attr_accessor :seats, :starting_seats, :nodes
+ attr_accessor :seats, :starting_seats, :matches
def initialize
@seats = []
@starting_seats = []
- @nodes = []
+ @matches = []
end
# Generates a Bracket object with placeholder empty hashes for each Seat in the
@@ -76,7 +76,7 @@ def to_h
{
'seats' => @seats.map { |s| { 'position' => s } },
'startingSeats' => @starting_seats,
- 'nodes' => @nodes
+ 'matches' => @matches
}
end
end
Oops, something went wrong.

0 comments on commit e4170ff

Please sign in to comment.