vzaar 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vzaar/base.rb +1 -0
- data/lib/vzaar/video_details.rb +47 -11
- metadata +2 -2
data/lib/vzaar/base.rb
CHANGED
data/lib/vzaar/video_details.rb
CHANGED
@@ -2,30 +2,66 @@ module Vzaar
|
|
2
2
|
|
3
3
|
class VideoDetails
|
4
4
|
|
5
|
-
attr_accessor :xml,
|
6
|
-
:author_account_type_id,
|
7
|
-
:
|
5
|
+
attr_accessor :xml,
|
6
|
+
:author_account_type_id,
|
7
|
+
:author_name,
|
8
|
+
:author_url,
|
9
|
+
:duration,
|
10
|
+
:framegrab_height,
|
11
|
+
:framegrab_url,
|
12
|
+
:framegrab_width,
|
13
|
+
:height,
|
14
|
+
:html,
|
15
|
+
:provider_name,
|
16
|
+
:provider_url,
|
17
|
+
:thumbnail_height,
|
18
|
+
:thumbnail_url,
|
19
|
+
:thumbnail_width,
|
20
|
+
:title,
|
21
|
+
:type,
|
22
|
+
:version,
|
23
|
+
:video_status_id,
|
24
|
+
:video_url,
|
25
|
+
:width
|
8
26
|
|
9
27
|
def initialize(xml)
|
10
28
|
@xml = xml
|
11
29
|
doc = REXML::Document.new xml
|
12
|
-
@
|
13
|
-
doc.elements['oembed/
|
14
|
-
@type = doc.elements['oembed/type'] ? doc.elements['oembed/type'].text : ''
|
15
|
-
@title = doc.elements['oembed/title'] ? doc.elements['oembed/title'].text : ''
|
30
|
+
@author_account_type_id = doc.elements['oembed/author_account'] ?
|
31
|
+
doc.elements['oembed/author_account'].text : ''
|
16
32
|
@author_name = doc.elements['oembed/author_name'] ?
|
17
33
|
doc.elements['oembed/author_name'].text : ''
|
18
34
|
@author_url = doc.elements['oembed/author_url'] ?
|
19
35
|
doc.elements['oembed/author_url'].text : ''
|
20
|
-
@
|
21
|
-
doc.elements['oembed/
|
36
|
+
@duration = doc.elements['oembed/duration'] ?
|
37
|
+
doc.elements['oembed/duration'].text : ''
|
38
|
+
@framegrab_height = doc.elements['oembed/framegrab_height'] ?
|
39
|
+
doc.elements['oembed/framegrab_height'].text : ''
|
40
|
+
@framegrab_url = doc.elements['oembed/framegrab_url'] ?
|
41
|
+
doc.elements['oembed/framegrab_url'].text : ''
|
42
|
+
@framegrab_width = doc.elements['oembed/framegrab_width'] ?
|
43
|
+
doc.elements['oembed/framegrab_width'].text : ''
|
44
|
+
@height = doc.elements['oembed/height'] ? doc.elements['oembed/height'].text : ''
|
45
|
+
@html = doc.elements['oembed/html'] ? doc.elements['oembed/html'].texts[1] : ''
|
22
46
|
@provider_name = doc.elements['oembed/provider_name'] ?
|
23
47
|
doc.elements['oembed/provider_name'].text : ''
|
24
48
|
@provider_url = doc.elements['oembed/provider_url'] ?
|
25
49
|
doc.elements['oembed/provider_url'].text : ''
|
26
|
-
@
|
50
|
+
@thumbnail_height = doc.elements['oembed/thumbnail_height'] ?
|
51
|
+
doc.elements['oembed/thumbnail_height'].text : ''
|
52
|
+
@thumbnail_url = doc.elements['oembed/thumbnail_url'] ?
|
53
|
+
doc.elements['oembed/thumbnail_url'].text : ''
|
54
|
+
@thumbnail_width = doc.elements['oembed/thumbnail_width'] ?
|
55
|
+
doc.elements['oembed/thumbnail_width'].text : ''
|
56
|
+
@title = doc.elements['oembed/title'] ? doc.elements['oembed/title'].text : ''
|
57
|
+
@type = doc.elements['oembed/type'] ? doc.elements['oembed/type'].text : ''
|
58
|
+
@version = doc.elements['oembed/version'] ?
|
59
|
+
doc.elements['oembed/version'].text : ''
|
60
|
+
@video_status_id = doc.elements['oembed/video_status_id'] ?
|
61
|
+
doc.elements['oembed/video_status_id'].text : ''
|
62
|
+
@video_url = doc.elements['oembed/video_url'] ?
|
63
|
+
doc.elements['oembed/video_url'].text : ''
|
27
64
|
@width = doc.elements['oembed/width'] ? doc.elements['oembed/width'].text : ''
|
28
|
-
@height = doc.elements['oembed/height'] ? doc.elements['oembed/height'].text : ''
|
29
65
|
end
|
30
66
|
|
31
67
|
end
|