Class: FilmOn::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/film_on/models/channel.rb

Overview

FilmOn::Channel Channel can have either a basic set of data or a more verbose set depending on whether it is called as part of a channels list or as in individual call from #channel, takes a raw hash and converts it into a nice ruby object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Channel

Returns a new instance of Channel.



18
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
48
49
50
51
52
53
# File 'lib/film_on/models/channel.rb', line 18

def initialize(hash)
  @id = hash["id"]
  @title = hash["title"]
  @alias = hash["alias"]
  @logo = hash["logo"]
  @big_logo = hash["big_logo"]
  @content_rating = hash["content_rating"]
  @adult_content = hash["adult_content"]
  @group = hash["group"]
  @group_id = hash["group_id"]
  @is_free = hash["is_free"]
  @is_free_sd_mode = hash["is_free_sd_mode"]
  @type = hash["type"]
  @has_tvguide = hash["has_tvguide"]
  @seekable = hash["seekable"]
  @serverside_record = hash["serverside_record"]
  @extra_big_logo = hash["extra_big_logo"]
  @upnp_enabled = hash["upnp_enabled"]
  @is_favorite = hash["is_favorite"]
  #extended
  @is_adult = hash["is_adult"]
  @is_interactive = hash["is_interactive"]
  @is_vod = hash["is_vod"]
  @is_vox = hash["is_vox"]
  @chat_keyword = hash["chat_keyword"]
  @recordable = hash["recordable"]
  @preload_message = hash["preload_message"]
  @preload_timeout = hash["preload_timeout"]
  @is_local = hash["is_local"]
  @preload_intro = hash["preload_intro"]
  @images = hash["images"]
  @schedule = hash["schedule"]
  @now_playing = hash["now_playing"] ? FilmOn::Programme.new(hash["now_playing"]) : nil
  @next_playing = hash["next_playing"] ? FilmOn::Programme.new(hash["next_playing"]) : nil
  @tvguide = get_tvguide(hash["tvguide"])
end

Instance Attribute Details

#adult_contentObject (readonly)

Returns the value of attribute adult_content.



11
12
13
# File 'lib/film_on/models/channel.rb', line 11

def adult_content
  @adult_content
end

#aliasObject (readonly)

Returns the value of attribute alias.



11
12
13
# File 'lib/film_on/models/channel.rb', line 11

def alias
  @alias
end

#big_logoObject (readonly)

Returns the value of attribute big_logo.



11
12
13
# File 'lib/film_on/models/channel.rb', line 11

def 
  @big_logo
end

#chat_keywordObject (readonly)

extended



15
16
17
# File 'lib/film_on/models/channel.rb', line 15

def chat_keyword
  @chat_keyword
end

#content_ratingObject (readonly)

Returns the value of attribute content_rating.



11
12
13
# File 'lib/film_on/models/channel.rb', line 11

def content_rating
  @content_rating
end

#extra_big_logoObject (readonly)

Returns the value of attribute extra_big_logo.



13
14
15
# File 'lib/film_on/models/channel.rb', line 13

def 
  @extra_big_logo
end

#groupObject (readonly)

Returns the value of attribute group.



12
13
14
# File 'lib/film_on/models/channel.rb', line 12

def group
  @group
end

#group_idObject (readonly)

Returns the value of attribute group_id.



12
13
14
# File 'lib/film_on/models/channel.rb', line 12

def group_id
  @group_id
end

#has_tvguideObject (readonly)

Returns the value of attribute has_tvguide.



12
13
14
# File 'lib/film_on/models/channel.rb', line 12

def has_tvguide
  @has_tvguide
end

#hashObject (readonly)

Returns the value of attribute hash.



11
12
13
# File 'lib/film_on/models/channel.rb', line 11

def hash
  @hash
end

#idObject (readonly)

Returns the value of attribute id.



11
12
13
# File 'lib/film_on/models/channel.rb', line 11

def id
  @id
end

#imagesObject (readonly)

Returns the value of attribute images.



16
17
18
# File 'lib/film_on/models/channel.rb', line 16

def images
  @images
end

#is_adultObject (readonly)

extended



15
16
17
# File 'lib/film_on/models/channel.rb', line 15

def is_adult
  @is_adult
end

#is_favoriteObject (readonly)

Returns the value of attribute is_favorite.



13
14
15
# File 'lib/film_on/models/channel.rb', line 13

def is_favorite
  @is_favorite
end

#is_freeObject (readonly)

Returns the value of attribute is_free.



12
13
14
# File 'lib/film_on/models/channel.rb', line 12

def is_free
  @is_free
end

#is_free_sd_modeObject (readonly)

Returns the value of attribute is_free_sd_mode.



12
13
14
# File 'lib/film_on/models/channel.rb', line 12

def is_free_sd_mode
  @is_free_sd_mode
end

#is_interactiveObject (readonly)

extended



15
16
17
# File 'lib/film_on/models/channel.rb', line 15

def is_interactive
  @is_interactive
end

#is_localObject (readonly)

Returns the value of attribute is_local.



16
17
18
# File 'lib/film_on/models/channel.rb', line 16

def is_local
  @is_local
end

#is_vodObject (readonly)

extended



15
16
17
# File 'lib/film_on/models/channel.rb', line 15

def is_vod
  @is_vod
end

#is_voxObject (readonly)

extended



15
16
17
# File 'lib/film_on/models/channel.rb', line 15

def is_vox
  @is_vox
end

#logoObject (readonly)

Returns the value of attribute logo.



11
12
13
# File 'lib/film_on/models/channel.rb', line 11

def 
  @logo
end

#next_playingObject (readonly)

Returns the value of attribute next_playing.



16
17
18
# File 'lib/film_on/models/channel.rb', line 16

def next_playing
  @next_playing
end

#now_playingObject (readonly)

Returns the value of attribute now_playing.



16
17
18
# File 'lib/film_on/models/channel.rb', line 16

def now_playing
  @now_playing
end

#preload_introObject (readonly)

Returns the value of attribute preload_intro.



16
17
18
# File 'lib/film_on/models/channel.rb', line 16

def preload_intro
  @preload_intro
end

#preload_messageObject (readonly)

Returns the value of attribute preload_message.



16
17
18
# File 'lib/film_on/models/channel.rb', line 16

def preload_message
  @preload_message
end

#preload_timeoutObject (readonly)

Returns the value of attribute preload_timeout.



16
17
18
# File 'lib/film_on/models/channel.rb', line 16

def preload_timeout
  @preload_timeout
end

#programmesObject (readonly)

extended



15
16
17
# File 'lib/film_on/models/channel.rb', line 15

def programmes
  @programmes
end

#recordableObject (readonly)

extended



15
16
17
# File 'lib/film_on/models/channel.rb', line 15

def recordable
  @recordable
end

#scheduleObject (readonly)

Returns the value of attribute schedule.



16
17
18
# File 'lib/film_on/models/channel.rb', line 16

def schedule
  @schedule
end

#seekableObject (readonly)

Returns the value of attribute seekable.



12
13
14
# File 'lib/film_on/models/channel.rb', line 12

def seekable
  @seekable
end

#serverside_recordObject (readonly)

Returns the value of attribute serverside_record.



13
14
15
# File 'lib/film_on/models/channel.rb', line 13

def serverside_record
  @serverside_record
end

#titleObject (readonly)

Returns the value of attribute title.



11
12
13
# File 'lib/film_on/models/channel.rb', line 11

def title
  @title
end

#tvguideObject (readonly)

Returns the value of attribute tvguide.



16
17
18
# File 'lib/film_on/models/channel.rb', line 16

def tvguide
  @tvguide
end

#typeObject (readonly)

Returns the value of attribute type.



12
13
14
# File 'lib/film_on/models/channel.rb', line 12

def type
  @type
end

#upnp_enabledObject (readonly)

Returns the value of attribute upnp_enabled.



13
14
15
# File 'lib/film_on/models/channel.rb', line 13

def upnp_enabled
  @upnp_enabled
end

Instance Method Details

#get_tvguide(guide) ⇒ Object



55
56
57
58
# File 'lib/film_on/models/channel.rb', line 55

def get_tvguide(guide)
  return [] unless guide
  guide.map{|gu| FilmOn::Programme.new(gu) }
end