Class: Program
Instance Attribute Summary collapse
-
#call_sign ⇒ Object
Returns the value of attribute call_sign.
-
#duration_min ⇒ Object
Returns the value of attribute duration_min.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#episode ⇒ Object
Returns the value of attribute episode.
-
#episode_title ⇒ Object
Returns the value of attribute episode_title.
-
#icons ⇒ Object
Returns the value of attribute icons.
-
#season ⇒ Object
Returns the value of attribute season.
-
#short_desc ⇒ Object
Returns the value of attribute short_desc.
-
#start_time_sec ⇒ Object
Returns the value of attribute start_time_sec.
-
#title ⇒ Object
Returns the value of attribute title.
-
#tms_guide_id ⇒ Object
Returns the value of attribute tms_guide_id.
-
#tms_program_id ⇒ Object
Returns the value of attribute tms_program_id.
-
#tms_series_id ⇒ Object
Returns the value of attribute tms_series_id.
-
#type ⇒ Object
Returns the value of attribute type.
-
#vod_tms_guide_id ⇒ Object
Returns the value of attribute vod_tms_guide_id.
Instance Method Summary collapse
-
#initialize(logger) ⇒ Program
constructor
A new instance of Program.
- #populate(program_hash) ⇒ Object
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_sign ⇒ Object
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_min ⇒ Object
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_time ⇒ Object
Returns the value of attribute end_time.
3 4 5 |
# File 'lib/data_services/program.rb', line 3 def end_time @end_time end |
#episode ⇒ Object
Returns the value of attribute episode.
3 4 5 |
# File 'lib/data_services/program.rb', line 3 def episode @episode end |
#episode_title ⇒ Object
Returns the value of attribute episode_title.
3 4 5 |
# File 'lib/data_services/program.rb', line 3 def episode_title @episode_title end |
#icons ⇒ Object
Returns the value of attribute icons.
3 4 5 |
# File 'lib/data_services/program.rb', line 3 def icons @icons end |
#season ⇒ Object
Returns the value of attribute season.
3 4 5 |
# File 'lib/data_services/program.rb', line 3 def season @season end |
#short_desc ⇒ Object
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_sec ⇒ Object
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 |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/data_services/program.rb', line 3 def title @title end |
#tms_guide_id ⇒ Object
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_id ⇒ Object
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_id ⇒ Object
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 |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/data_services/program.rb', line 3 def type @type end |
#vod_tms_guide_id ⇒ Object
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 |