Class: Statium::Opta::Model::Venue

Inherits:
Object
  • Object
show all
Defined in:
lib/statium/opta/model/venue.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Venue

Returns a new instance of Venue



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/statium/opta/model/venue.rb', line 25

def initialize(params)
  params.each do |key, value|
    instance_variable_set("@#{key}", value)
  end

  @contestants = []
  if params["contestant"] != nil
    params["contestant"].each do |contestant_params|
      @contestants << Contestant.new(contestant_params)
    end
  end
end

Instance Attribute Details

#addressObject

Returns the value of attribute address



11
12
13
# File 'lib/statium/opta/model/venue.rb', line 11

def address
  @address
end

#capacityObject

Returns the value of attribute capacity



13
14
15
# File 'lib/statium/opta/model/venue.rb', line 13

def capacity
  @capacity
end

#cityObject

Returns the value of attribute city



7
8
9
# File 'lib/statium/opta/model/venue.rb', line 7

def city
  @city
end

#contestantsObject

Returns the value of attribute contestants



17
18
19
# File 'lib/statium/opta/model/venue.rb', line 17

def contestants
  @contestants
end

#countryObject

Returns the value of attribute country



9
10
11
# File 'lib/statium/opta/model/venue.rb', line 9

def country
  @country
end

#countryCodeObject

Returns the value of attribute countryCode



10
11
12
# File 'lib/statium/opta/model/venue.rb', line 10

def countryCode
  @countryCode
end

#countryIdObject

Returns the value of attribute countryId



8
9
10
# File 'lib/statium/opta/model/venue.rb', line 8

def countryId
  @countryId
end

#idObject

Returns the value of attribute id



5
6
7
# File 'lib/statium/opta/model/venue.rb', line 5

def id
  @id
end

#mapsGeoCodeLatitudeObject

Returns the value of attribute mapsGeoCodeLatitude



15
16
17
# File 'lib/statium/opta/model/venue.rb', line 15

def mapsGeoCodeLatitude
  @mapsGeoCodeLatitude
end

#mapsGeoCodeLongitudeObject

Returns the value of attribute mapsGeoCodeLongitude



16
17
18
# File 'lib/statium/opta/model/venue.rb', line 16

def mapsGeoCodeLongitude
  @mapsGeoCodeLongitude
end

#nameObject

Returns the value of attribute name



6
7
8
# File 'lib/statium/opta/model/venue.rb', line 6

def name
  @name
end

#openedObject

Returns the value of attribute opened



12
13
14
# File 'lib/statium/opta/model/venue.rb', line 12

def opened
  @opened
end

#surfaceObject

Returns the value of attribute surface



14
15
16
# File 'lib/statium/opta/model/venue.rb', line 14

def surface
  @surface
end

Class Method Details

.build(params) ⇒ Object



19
20
21
22
23
# File 'lib/statium/opta/model/venue.rb', line 19

def self.build params
  venues = params["venue"]
  raise "Invalid number of venues" unless venues.count == 1
  return Statium::Opta::Model::Venue.new(venues[0])
end