Class: Infostrada::Edition

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/infostrada/edition.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Edition

Returns a new instance of Edition.



16
17
18
19
20
21
22
23
24
25
# File 'lib/infostrada/edition.rb', line 16

def initialize(hash)
  @id = hash.delete('n_EditionID')
  @season = hash.delete('c_Season')
  @start_date = Formatter.format_date(hash.delete('d_EditionStartDate'))
  @end_date = Formatter.format_date(hash.delete('d_EditionEndDate'))

  @competition = Competition.new(hash)

  self
end

Instance Attribute Details

#competitionObject

Returns the value of attribute competition.



7
8
9
# File 'lib/infostrada/edition.rb', line 7

def competition
  @competition
end

#end_dateObject

Returns the value of attribute end_date.



7
8
9
# File 'lib/infostrada/edition.rb', line 7

def end_date
  @end_date
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/infostrada/edition.rb', line 7

def id
  @id
end

#seasonObject

Returns the value of attribute season.



7
8
9
# File 'lib/infostrada/edition.rb', line 7

def season
  @season
end

#start_dateObject

Returns the value of attribute start_date.



7
8
9
# File 'lib/infostrada/edition.rb', line 7

def start_date
  @start_date
end

Class Method Details

.allObject



12
13
14
# File 'lib/infostrada/edition.rb', line 12

def self.all
  editions = EditionRequest.get_list
end

Instance Method Details

#phasesObject

Get phases for this edition



32
33
34
# File 'lib/infostrada/edition.rb', line 32

def phases
  Phase.where(edition_id: id)
end

#teamsObject



27
28
29
# File 'lib/infostrada/edition.rb', line 27

def teams
  Team.all(id)
end