Class: Program

Inherits:
Object show all
Defined in:
lib/data_services/program.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ Program

Returns a new instance of Program.



4
5
6
7
8
9
10
11
12
13
# File 'lib/data_services/program.rb', line 4

def initialize(logger)
  @logger = logger
  @title = nil
  @episode_title = nil
  @tms_guide_id = nil
  @tms_program_id = nil
  @short_desc = nil
  @start_time_sec = nil
  @end_time  = nil
end

Instance Attribute Details

#call_signObject

Returns the value of attribute call_sign.



3
4
5
# File 'lib/data_services/program.rb', line 3

def call_sign
  @call_sign
end

#duration_minObject

Returns the value of attribute duration_min.



3
4
5
# File 'lib/data_services/program.rb', line 3

def duration_min
  @duration_min
end

#end_timeObject

Returns the value of attribute end_time.



3
4
5
# File 'lib/data_services/program.rb', line 3

def end_time
  @end_time
end

#episodeObject

Returns the value of attribute episode.



3
4
5
# File 'lib/data_services/program.rb', line 3

def episode
  @episode
end

#episode_titleObject

Returns the value of attribute episode_title.



3
4
5
# File 'lib/data_services/program.rb', line 3

def episode_title
  @episode_title
end

#iconsObject

Returns the value of attribute icons.



3
4
5
# File 'lib/data_services/program.rb', line 3

def icons
  @icons
end

#seasonObject

Returns the value of attribute season.



3
4
5
# File 'lib/data_services/program.rb', line 3

def season
  @season
end

#short_descObject

Returns the value of attribute short_desc.



3
4
5
# File 'lib/data_services/program.rb', line 3

def short_desc
  @short_desc
end

#start_time_secObject

Returns the value of attribute start_time_sec.



3
4
5
# File 'lib/data_services/program.rb', line 3

def start_time_sec
  @start_time_sec
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/data_services/program.rb', line 3

def title
  @title
end

#tms_guide_idObject

Returns the value of attribute tms_guide_id.



3
4
5
# File 'lib/data_services/program.rb', line 3

def tms_guide_id
  @tms_guide_id
end

#tms_program_idObject

Returns the value of attribute tms_program_id.



3
4
5
# File 'lib/data_services/program.rb', line 3

def tms_program_id
  @tms_program_id
end

#tms_series_idObject

Returns the value of attribute tms_series_id.



3
4
5
# File 'lib/data_services/program.rb', line 3

def tms_series_id
  @tms_series_id
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/data_services/program.rb', line 3

def type
  @type
end

#vod_tms_guide_idObject

Returns the value of attribute vod_tms_guide_id.



3
4
5
# File 'lib/data_services/program.rb', line 3

def vod_tms_guide_id
  @vod_tms_guide_id
end

Instance Method Details

#populate(program_hash) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/data_services/program.rb', line 19

def populate program_hash
  @tms_guide_id = program_hash["tmsGuideId"]
  @tms_program_id = program_hash["tmsProgramId"]
  @call_sign = program_hash["callSign"]
  @vod_tms_guide_id = program_hash["vodTmsSeriesId"]
  @title = program_hash["title"]
  @short_desc = program_hash["shortDesc"]
  @icons = program_hash["icons"]

   = program_hash["metadata"]
  unless (.nil?)
    @tms_series_id = ["tmsSeriesId"]
    @season = ["season"]
    @episode = ["episode"]
    @episode_title = ["title"]
    @type = ["type"]
  end

  @start_time_sec = program_hash["startTimeSec"]
  @duration_min  = program_hash["durationMinutes"]
  if (! @start_time_sec.nil?  &&  ! @duration_min.nil?)
    sec = @duration_min.to_i * 60
    @end_time = @start_time_sec + sec
  end

  @genres = program_hash["genres"]
  @rating = program_hash["rating"]
  @ratings_blocked = program_hash["ratingsBlocked"]
end