Class: Infostrada::Competition

Inherits:
Object
  • Object
show all
Defined in:
lib/infostrada/competition.rb

Overview

n_CompetitionSet is an indicator for the type of Competition:

1 = domestic league 2 = domestic cup 3 = international club competition (e.g. Champions League) 4 = country competition (e.g. World Cup)

n_CompetitionLevel is an indicator for the level of a domestic competition:

1 = highest level (e.g. German Bundesliga) 2 = 2nd highest level (e.g. German 2. Bundesliga) 3 = 3rd highest level and so on

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Competition

Returns a new instance of Competition.



17
18
19
20
21
22
# File 'lib/infostrada/competition.rb', line 17

def initialize(hash)
  @id = hash.delete('n_CompetitionID')
  @name = hash.delete('c_Competition')

  @nation = Nation.new(hash, 'competition')
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



15
16
17
# File 'lib/infostrada/competition.rb', line 15

def id
  @id
end

#levelObject

Returns the value of attribute level.



15
16
17
# File 'lib/infostrada/competition.rb', line 15

def level
  @level
end

#nameObject

Returns the value of attribute name.



15
16
17
# File 'lib/infostrada/competition.rb', line 15

def name
  @name
end

#nationObject

Returns the value of attribute nation.



15
16
17
# File 'lib/infostrada/competition.rb', line 15

def nation
  @nation
end

#setObject

Returns the value of attribute set.



15
16
17
# File 'lib/infostrada/competition.rb', line 15

def set
  @set
end