Class: BrowseMediaItem

Inherits:
MediaItem show all
Defined in:
lib/etvnet_seek/core/browse_media_item.rb

Instance Attribute Summary collapse

Attributes inherited from MediaItem

#additional_info, #link, #media_file, #text, #underscore_name

Instance Method Summary collapse

Methods inherited from MediaItem

#==, #access_page?

Constructor Details

#initialize(text, link) ⇒ BrowseMediaItem

Returns a new instance of BrowseMediaItem.



4
5
6
# File 'lib/etvnet_seek/core/browse_media_item.rb', line 4

def initialize(text, link)
  super(text, link)
end

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



2
3
4
# File 'lib/etvnet_seek/core/browse_media_item.rb', line 2

def channel
  @channel
end

#durationObject

Returns the value of attribute duration.



2
3
4
# File 'lib/etvnet_seek/core/browse_media_item.rb', line 2

def duration
  @duration
end

#folderObject

Returns the value of attribute folder.



2
3
4
# File 'lib/etvnet_seek/core/browse_media_item.rb', line 2

def folder
  @folder
end

#imageObject

Returns the value of attribute image.



2
3
4
# File 'lib/etvnet_seek/core/browse_media_item.rb', line 2

def image
  @image
end

#ratingObject

Returns the value of attribute rating.



2
3
4
# File 'lib/etvnet_seek/core/browse_media_item.rb', line 2

def rating
  @rating
end

#rating_imageObject

Returns the value of attribute rating_image.



2
3
4
# File 'lib/etvnet_seek/core/browse_media_item.rb', line 2

def rating_image
  @rating_image
end

#showtimeObject

Returns the value of attribute showtime.



2
3
4
# File 'lib/etvnet_seek/core/browse_media_item.rb', line 2

def showtime
  @showtime
end

#yearObject

Returns the value of attribute year.



2
3
4
# File 'lib/etvnet_seek/core/browse_media_item.rb', line 2

def year
  @year
end

Instance Method Details

#folder?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/etvnet_seek/core/browse_media_item.rb', line 8

def folder?
  folder == true
end

#to_sObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/etvnet_seek/core/browse_media_item.rb', line 12

def to_s
  #buffer = ""
  if folder?
    buffer = "*** Folder *** "
  else
    buffer = ""
  end

  buffer += text

  unless folder?
    if underscore_name
      buffer += ": #{underscore_name}"
    else
      buffer += ": #{link}"
    end
  end

  buffer += " --- #{showtime}" if showtime

  buffer += " (#{media_file})" if not media_file.nil? and media_file.size > 0
  buffer += " --- #{year}" if not year.nil? and year.size > 2
  buffer += " --- #{duration}" if not duration.nil? and duration.size > 0
  buffer += " --- #{channel}" if channel 
  buffer += " --- #{image}" if image
  buffer += " --- #{rating_image}" if rating_image
  
  buffer
end