Class: FilmOn::Base
- Inherits:
-
Object
- Object
- FilmOn::Base
- Includes:
- ChannelHelper, GroupHelper, Services
- Defined in:
- lib/film_on/base.rb
Constant Summary collapse
- URI =
"www.filmon.com/tv/api/"
Instance Attribute Summary collapse
-
#app_key ⇒ Object
readonly
Returns the value of attribute app_key.
-
#app_secret ⇒ Object
readonly
Returns the value of attribute app_secret.
-
#session_key ⇒ Object
readonly
Returns the value of attribute session_key.
Instance Method Summary collapse
- #init_request ⇒ Object
-
#initialize(app_key, app_secret) ⇒ Base
constructor
A new instance of Base.
Methods included from GroupHelper
Methods included from ChannelHelper
#convert_channel, #convert_channels
Methods included from Services
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_key ⇒ Object (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_secret ⇒ Object (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_key ⇒ Object (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_request ⇒ Object
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 |