Class: FilmOn::Base

Inherits:
Object
  • Object
show all
Includes:
ChannelHelper, GroupHelper, Services
Defined in:
lib/film_on/base.rb

Constant Summary collapse

URI =
"www.filmon.com/tv/api/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GroupHelper

#convert_groups, #find_group

Methods included from ChannelHelper

#convert_channel, #convert_channels

Methods included from Services

#channel, #channels, #groups

Constructor Details

#initialize(app_key, app_secret) ⇒ Base



15
16
17
18
19
20
# File 'lib/film_on/base.rb', line 15

def initialize(app_key, app_secret)
  @app_key = app_key
  @app_secret = app_secret
  @channel = {}
  init_request
end

Instance Attribute Details

#app_keyObject (readonly)

Returns the value of attribute app_key.



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

def app_key
  @app_key
end

#app_secretObject (readonly)

Returns the value of attribute app_secret.



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

def app_secret
  @app_secret
end

#session_keyObject (readonly)

Returns the value of attribute session_key.



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

def session_key
  @session_key
end

Instance Method Details

#init_requestObject



22
23
24
25
26
27
# File 'lib/film_on/base.rb', line 22

def init_request
  response = get("init")
  init_hash = JSON.parse(response)
  @session_key = init_hash["session_key"]
  self
end