Class: SportsDataApi::Golf::Summary

Inherits:
Object
  • Object
show all
Defined in:
lib/sports_data_api/golf/summary.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tour, year, data) ⇒ Summary



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/sports_data_api/golf/summary.rb', line 8

def initialize(tour, year, data)
  @tour = tour
  @year = year
  @data = data
  @id = data['id']
  @name = data['name']
  @purse = data['purse']
  @winning_share = data['winning_share']
  @currency = data['currency']
  @points = data['points']
  @event_type = data['event_type']
  @start_date = data['start_date']
  @end_date = data['end_date']
  @course_timezone = data['course_timezone']
  @coverage = data['coverage']
  @status = data['status']
end

Instance Attribute Details

#course_timezoneObject (readonly)

Returns the value of attribute course_timezone.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def course_timezone
  @course_timezone
end

#coverageObject (readonly)

Returns the value of attribute coverage.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def coverage
  @coverage
end

#currencyObject (readonly)

Returns the value of attribute currency.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def currency
  @currency
end

#end_dateObject (readonly)

Returns the value of attribute end_date.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def end_date
  @end_date
end

#event_typeObject (readonly)

Returns the value of attribute event_type.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def event_type
  @event_type
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def name
  @name
end

#pointsObject (readonly)

Returns the value of attribute points.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def points
  @points
end

#purseObject (readonly)

Returns the value of attribute purse.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def purse
  @purse
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def start_date
  @start_date
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def status
  @status
end

#tourObject (readonly)

Returns the value of attribute tour.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def tour
  @tour
end

#winning_shareObject (readonly)

Returns the value of attribute winning_share.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def winning_share
  @winning_share
end

#yearObject (readonly)

Returns the value of attribute year.



4
5
6
# File 'lib/sports_data_api/golf/summary.rb', line 4

def year
  @year
end

Instance Method Details

#fieldObject



26
27
28
29
30
# File 'lib/sports_data_api/golf/summary.rb', line 26

def field
  @field ||= safe_map('field') do |json|
    SportsDataApi::Golf::Player.new(json)
  end
end

#roundsObject



32
33
34
35
36
# File 'lib/sports_data_api/golf/summary.rb', line 32

def rounds
  @rounds ||= safe_map('rounds') do |json|
    SportsDataApi::Golf::Round.new(json)
  end
end