Class: Statium::Opta::Model::Competition
- Inherits:
-
Object
- Object
- Statium::Opta::Model::Competition
- Defined in:
- lib/statium/opta/model/competition.rb
Instance Attribute Summary collapse
-
#competitionFormat ⇒ Object
Returns the value of attribute competitionFormat.
-
#country ⇒ Object
Returns the value of attribute country.
-
#countryId ⇒ Object
Returns the value of attribute countryId.
-
#id ⇒ Object
Returns the value of attribute id.
-
#isFriendly ⇒ Object
Returns the value of attribute isFriendly.
-
#name ⇒ Object
Returns the value of attribute name.
-
#ocId ⇒ Object
Returns the value of attribute ocId.
-
#opId ⇒ Object
Returns the value of attribute opId.
-
#tournamentCalendars ⇒ Object
Returns the value of attribute tournamentCalendars.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params) ⇒ Competition
constructor
A new instance of Competition.
Constructor Details
#initialize(params) ⇒ Competition
Returns a new instance of Competition
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/statium/opta/model/competition.rb', line 24 def initialize(params) params.each do |key, value| instance_variable_set("@#{key}", value) end @tournamentCalendars = [] if params["tournamentCalendar"] != nil params["tournamentCalendar"].each do |tournament_calendar_params| @tournamentCalendars << TournamentCalendar.new(tournament_calendar_params) end end end |
Instance Attribute Details
#competitionFormat ⇒ Object
Returns the value of attribute competitionFormat
12 13 14 |
# File 'lib/statium/opta/model/competition.rb', line 12 def competitionFormat @competitionFormat end |
#country ⇒ Object
Returns the value of attribute country
9 10 11 |
# File 'lib/statium/opta/model/competition.rb', line 9 def country @country end |
#countryId ⇒ Object
Returns the value of attribute countryId
10 11 12 |
# File 'lib/statium/opta/model/competition.rb', line 10 def countryId @countryId end |
#id ⇒ Object
Returns the value of attribute id
5 6 7 |
# File 'lib/statium/opta/model/competition.rb', line 5 def id @id end |
#isFriendly ⇒ Object
Returns the value of attribute isFriendly
11 12 13 |
# File 'lib/statium/opta/model/competition.rb', line 11 def isFriendly @isFriendly end |
#name ⇒ Object
Returns the value of attribute name
8 9 10 |
# File 'lib/statium/opta/model/competition.rb', line 8 def name @name end |
#ocId ⇒ Object
Returns the value of attribute ocId
6 7 8 |
# File 'lib/statium/opta/model/competition.rb', line 6 def ocId @ocId end |
#opId ⇒ Object
Returns the value of attribute opId
7 8 9 |
# File 'lib/statium/opta/model/competition.rb', line 7 def opId @opId end |
#tournamentCalendars ⇒ Object
Returns the value of attribute tournamentCalendars
14 15 16 |
# File 'lib/statium/opta/model/competition.rb', line 14 def tournamentCalendars @tournamentCalendars end |
#type ⇒ Object
Returns the value of attribute type
13 14 15 |
# File 'lib/statium/opta/model/competition.rb', line 13 def type @type end |
Class Method Details
.build(params) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/statium/opta/model/competition.rb', line 16 def self.build params all_competitions = [] params["competition"].each do |competition_params| all_competitions << Competition.new(competition_params) end all_competitions end |