letteropend 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/getFilmDetails.rb +3 -0
- data/lib/letteropend/film.rb +11 -1
- data/lib/letteropend/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6cdb0d4f3c01c57f54e2ec50cf5e6a4db37ac1e
|
4
|
+
data.tar.gz: 9ebe34eea4c67947da344db67b8dea136c3ef0e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccd759632bc898725b6293eb53e3f3145e4a492d3894a8e20d8fb581e0cc6ddcc82613e065246284609a911b5752100cfdadad244ddb3001baa64efada72e8cf
|
7
|
+
data.tar.gz: 896f9ba1a0f915169d1ed6d4621cad9060208296cf93375178fc9942b628b9d8b2cb3ffc0577a61ad65431eb6657e3a5e557fe43013d669cd0f7d255fb29fa59
|
data/examples/getFilmDetails.rb
CHANGED
data/lib/letteropend/film.rb
CHANGED
@@ -3,7 +3,7 @@ require "open-uri"
|
|
3
3
|
|
4
4
|
module Letteropend
|
5
5
|
class Film
|
6
|
-
attr_reader :title, :url, :runtime, :tagline
|
6
|
+
attr_reader :title, :url, :runtime, :tagline, :overview
|
7
7
|
def initialize(title, url, callbacks={})
|
8
8
|
@title = title
|
9
9
|
@url = url
|
@@ -25,6 +25,13 @@ module Letteropend
|
|
25
25
|
@tagline
|
26
26
|
end
|
27
27
|
|
28
|
+
def overview
|
29
|
+
if !@pulled
|
30
|
+
pull_data
|
31
|
+
end
|
32
|
+
@overview
|
33
|
+
end
|
34
|
+
|
28
35
|
def pull_data
|
29
36
|
if @callbacks[:pulling_film]
|
30
37
|
@callbacks[:pulling_film].call(self)
|
@@ -44,6 +51,9 @@ module Letteropend
|
|
44
51
|
|
45
52
|
# get the tagline for the film
|
46
53
|
@tagline = page.css(".tagline").text
|
54
|
+
|
55
|
+
# get the overview for the film
|
56
|
+
@overview = page.css("div.truncate").text.strip
|
47
57
|
|
48
58
|
if @callbacks[:pulled_film]
|
49
59
|
@callbacks[:pulled_film].call(self)
|
data/lib/letteropend/version.rb
CHANGED