film_on 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4174f8ce1370ebefb6c615fac66fc3d58b498a82
4
- data.tar.gz: ef1756d9e5d8f763e57dc90c007011a932b65caf
3
+ metadata.gz: e807fafd2a9389c0d5aadd5beee263d2d7df225b
4
+ data.tar.gz: 3c479794f5a7824246f1ddc7d2018b167cb7861d
5
5
  SHA512:
6
- metadata.gz: b42460c154426653f820e04e0c4c8d61d6ad251424d578508e04f2dbc98de9a51917471c977eb5b2887d869060adbe79aa6b81629e7f12f289ae4fd088ae6f0b
7
- data.tar.gz: bcca8cbc312055c9cafe9663bcc309e80bcdd0096ce3d0cfe64e1827516f57f652a15351b72dc8e06962bc75b0ba9c39a17ba3e153885fe942f5d49b08fa9d24
6
+ metadata.gz: 687825d8c2c12afc729eca40a6eccc93d0b98150b48990e2b84ea7421d1bdb64853415b0a28cb5fabc4c4429321313188e400c2b1d59ceaa2fb2814ec617f057
7
+ data.tar.gz: f69e4acf1ca6e935398f68d1d16e5f4c4561cfeae94c20ef35be00312998f9e79f6e4a1748f345c0f3f79e3907bd453f68149898268d4c8d08898206545c233c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
data/lib/film_on/base.rb CHANGED
@@ -5,6 +5,8 @@ module FilmOn
5
5
  class Base
6
6
 
7
7
  include Services
8
+ include ChannelHelper
9
+ include GroupHelper
8
10
 
9
11
  URI = "www.filmon.com/tv/api/"
10
12
 
@@ -0,0 +1,16 @@
1
+ module FilmOn
2
+
3
+ module ChannelHelper
4
+
5
+ def convert_channel(id,json)
6
+ hash = JSON.parse(json)
7
+ FilmOn::Channel.new(hash)
8
+ end
9
+
10
+ def convert_channels(json)
11
+ hash = JSON.parse(json)
12
+ hash.map{|ch| FilmOn::Channel.new(ch)}
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ module FilmOn
2
+ module GroupHelper
3
+
4
+ def convert_groups(json)
5
+ hash = JSON.parse(json)
6
+ hash.map{|gr| FilmOn::Group.new(gr)}
7
+ end
8
+
9
+ def find_group(id)
10
+ groups.select{|gr| gr.id == id}.first
11
+ end
12
+
13
+ end
14
+ end
@@ -9,12 +9,7 @@ module FilmOn
9
9
  @channel[id] = json
10
10
  return json
11
11
  end
12
- convert_channel(id, json)
13
- end
14
-
15
- def convert_channel(id, json)
16
- hash = JSON.parse(json)
17
- @channel[id] = FilmOn::Channel.new(hash)
12
+ @channel[id] = convert_channel(id, json)
18
13
  end
19
14
 
20
15
  def channels(opts={})
@@ -24,12 +19,7 @@ module FilmOn
24
19
  @channels = json
25
20
  return json
26
21
  end
27
- convert_channels(json)
28
- end
29
-
30
- def convert_channels(json)
31
- hash = JSON.parse(json)
32
- @channels = hash.map{|ch| FilmOn::Channel.new(ch)}
22
+ @channels = convert_channels(json)
33
23
  end
34
24
 
35
25
  def groups(opts={})
@@ -39,12 +29,7 @@ module FilmOn
39
29
  @groups = json
40
30
  return json
41
31
  end
42
- convert_groups(json)
43
- end
44
-
45
- def convert_groups(json)
46
- hash = JSON.parse(json)
47
- @groups = hash.map{|gr| FilmOn::Group.new(gr)}
32
+ @groups = convert_groups(json)
48
33
  end
49
34
 
50
35
  end
data/lib/film_on.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  require "film_on/version"
2
2
  require "film_on/services"
3
+ require "film_on/helpers/channel_helper"
4
+ require "film_on/helpers/group_helper"
3
5
  require "film_on/base"
4
6
  require "film_on/models/channel"
5
7
  require "film_on/models/group"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: film_on
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Hanscombe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-01 00:00:00.000000000 Z
11
+ date: 2015-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,6 +114,8 @@ files:
114
114
  - film_on.gemspec
115
115
  - lib/film_on.rb
116
116
  - lib/film_on/base.rb
117
+ - lib/film_on/helpers/channel_helper.rb
118
+ - lib/film_on/helpers/group_helper.rb
117
119
  - lib/film_on/models/channel.rb
118
120
  - lib/film_on/models/group.rb
119
121
  - lib/film_on/models/programme.rb