Class: Challonge::Tournament

Inherits:
API
  • Object
show all
Defined in:
lib/challonge/tournament.rb

Instance Method Summary collapse

Methods inherited from API

key, key=, username, username=

Instance Method Details

#descriptionObject



4
5
6
7
8
# File 'lib/challonge/tournament.rb', line 4

def description
  if self.attributes.include?('description_source')
    self.description_source
  end
end

#description=(val) ⇒ Object



10
11
12
# File 'lib/challonge/tournament.rb', line 10

def description=(val)
  self.description_source = val
end

#matches(scope = :all) ⇒ Object



30
31
32
# File 'lib/challonge/tournament.rb', line 30

def matches(scope = :all)
  Challonge::Match.find(scope, :params => {:tournament_id => self.id})
end

#participants(scope = :all) ⇒ Object



26
27
28
# File 'lib/challonge/tournament.rb', line 26

def participants(scope = :all)
  Challonge::Participant.find(scope, :params => {:tournament_id => self.id})
end

#publish!Object



14
15
16
# File 'lib/challonge/tournament.rb', line 14

def publish!
  validated_post(:publish)
end

#reset!Object



22
23
24
# File 'lib/challonge/tournament.rb', line 22

def reset!
  validated_post(:reset)
end

#start!Object



18
19
20
# File 'lib/challonge/tournament.rb', line 18

def start!
  validated_post(:start)
end