flickraw_objects 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -8
  3. data/lib/doc/FlickrawObjects.html +98 -0
  4. data/lib/doc/FlickrawObjects/Person.html +495 -0
  5. data/lib/doc/FlickrawObjects/Photo.html +552 -0
  6. data/lib/doc/FlickrawObjects/Photoset.html +343 -0
  7. data/lib/doc/created.rid +2 -0
  8. data/lib/doc/fonts.css +167 -0
  9. data/lib/doc/fonts/Lato-Light.ttf +0 -0
  10. data/lib/doc/fonts/Lato-LightItalic.ttf +0 -0
  11. data/lib/doc/fonts/Lato-Regular.ttf +0 -0
  12. data/lib/doc/fonts/Lato-RegularItalic.ttf +0 -0
  13. data/lib/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  14. data/lib/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  15. data/lib/doc/images/add.png +0 -0
  16. data/lib/doc/images/arrow_up.png +0 -0
  17. data/lib/doc/images/brick.png +0 -0
  18. data/lib/doc/images/brick_link.png +0 -0
  19. data/lib/doc/images/bug.png +0 -0
  20. data/lib/doc/images/bullet_black.png +0 -0
  21. data/lib/doc/images/bullet_toggle_minus.png +0 -0
  22. data/lib/doc/images/bullet_toggle_plus.png +0 -0
  23. data/lib/doc/images/date.png +0 -0
  24. data/lib/doc/images/delete.png +0 -0
  25. data/lib/doc/images/find.png +0 -0
  26. data/lib/doc/images/loadingAnimation.gif +0 -0
  27. data/lib/doc/images/macFFBgHack.png +0 -0
  28. data/lib/doc/images/package.png +0 -0
  29. data/lib/doc/images/page_green.png +0 -0
  30. data/lib/doc/images/page_white_text.png +0 -0
  31. data/lib/doc/images/page_white_width.png +0 -0
  32. data/lib/doc/images/plugin.png +0 -0
  33. data/lib/doc/images/ruby.png +0 -0
  34. data/lib/doc/images/tag_blue.png +0 -0
  35. data/lib/doc/images/tag_green.png +0 -0
  36. data/lib/doc/images/transparent.png +0 -0
  37. data/lib/doc/images/wrench.png +0 -0
  38. data/lib/doc/images/wrench_orange.png +0 -0
  39. data/lib/doc/images/zoom.png +0 -0
  40. data/lib/doc/index.html +89 -0
  41. data/lib/doc/js/darkfish.js +140 -0
  42. data/lib/doc/js/jquery.js +18 -0
  43. data/lib/doc/js/navigation.js +142 -0
  44. data/lib/doc/js/search.js +109 -0
  45. data/lib/doc/js/search_index.js +1 -0
  46. data/lib/doc/js/searcher.js +228 -0
  47. data/lib/doc/rdoc.css +580 -0
  48. data/lib/doc/table_of_contents.html +196 -0
  49. data/lib/flickraw_objects.rb +40 -13
  50. data/lib/flickraw_objects.rb~ +71 -48
  51. data/lib/flickraw_objects/version.rb +1 -1
  52. data/lib/flickraw_objects/version.rb~ +1 -1
  53. metadata +50 -5
  54. data/lib/flickraw_objects/attributes.rb~ +0 -70
@@ -0,0 +1,196 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>Table of Contents - RDoc Documentation</title>
8
+
9
+ <link href="./fonts.css" rel="stylesheet">
10
+ <link href="./rdoc.css" rel="stylesheet">
11
+
12
+ <script type="text/javascript">
13
+ var rdoc_rel_prefix = "./";
14
+ </script>
15
+
16
+ <script src="./js/jquery.js"></script>
17
+ <script src="./js/navigation.js"></script>
18
+ <script src="./js/search_index.js"></script>
19
+ <script src="./js/search.js"></script>
20
+ <script src="./js/searcher.js"></script>
21
+ <script src="./js/darkfish.js"></script>
22
+
23
+
24
+ <body id="top" class="table-of-contents">
25
+ <main role="main">
26
+ <h1 class="class">Table of Contents - RDoc Documentation</h1>
27
+
28
+
29
+ <h2 id="classes">Classes and Modules</h2>
30
+ <ul>
31
+ <li class="module">
32
+ <a href="FlickrawObjects.html">FlickrawObjects</a>
33
+ </li>
34
+ <li class="class">
35
+ <a href="FlickrawObjects/Person.html">FlickrawObjects::Person</a>
36
+ </li>
37
+ <li class="class">
38
+ <a href="FlickrawObjects/Photo.html">FlickrawObjects::Photo</a>
39
+ </li>
40
+ <li class="class">
41
+ <a href="FlickrawObjects/Photoset.html">FlickrawObjects::Photoset</a>
42
+ </li>
43
+ </ul>
44
+
45
+ <h2 id="methods">Methods</h2>
46
+ <ul>
47
+
48
+ <li class="method">
49
+ <a href="FlickrawObjects/Person.html#method-c-find_by_username">::find_by_username</a>
50
+ &mdash;
51
+ <span class="container">FlickrawObjects::Person</span>
52
+
53
+ <li class="method">
54
+ <a href="FlickrawObjects/Photo.html#method-c-url">::url</a>
55
+ &mdash;
56
+ <span class="container">FlickrawObjects::Photo</span>
57
+
58
+ <li class="method">
59
+ <a href="FlickrawObjects/Photoset.html#method-i-description">#description</a>
60
+ &mdash;
61
+ <span class="container">FlickrawObjects::Photoset</span>
62
+
63
+ <li class="method">
64
+ <a href="FlickrawObjects/Photo.html#method-i-family">#family</a>
65
+ &mdash;
66
+ <span class="container">FlickrawObjects::Photo</span>
67
+
68
+ <li class="method">
69
+ <a href="FlickrawObjects/Photo.html#method-i-farm">#farm</a>
70
+ &mdash;
71
+ <span class="container">FlickrawObjects::Photo</span>
72
+
73
+ <li class="method">
74
+ <a href="FlickrawObjects/Person.html#method-i-first_date">#first_date</a>
75
+ &mdash;
76
+ <span class="container">FlickrawObjects::Person</span>
77
+
78
+ <li class="method">
79
+ <a href="FlickrawObjects/Person.html#method-i-get_info">#get_info</a>
80
+ &mdash;
81
+ <span class="container">FlickrawObjects::Person</span>
82
+
83
+ <li class="method">
84
+ <a href="FlickrawObjects/Photoset.html#method-i-get_info">#get_info</a>
85
+ &mdash;
86
+ <span class="container">FlickrawObjects::Photoset</span>
87
+
88
+ <li class="method">
89
+ <a href="FlickrawObjects/Person.html#method-i-get_photos">#get_photos</a>
90
+ &mdash;
91
+ <span class="container">FlickrawObjects::Person</span>
92
+
93
+ <li class="method">
94
+ <a href="FlickrawObjects/Photoset.html#method-i-get_photos">#get_photos</a>
95
+ &mdash;
96
+ <span class="container">FlickrawObjects::Photoset</span>
97
+
98
+ <li class="method">
99
+ <a href="FlickrawObjects/Person.html#method-i-get_photosets">#get_photosets</a>
100
+ &mdash;
101
+ <span class="container">FlickrawObjects::Person</span>
102
+
103
+ <li class="method">
104
+ <a href="FlickrawObjects/Person.html#method-i-id">#id</a>
105
+ &mdash;
106
+ <span class="container">FlickrawObjects::Person</span>
107
+
108
+ <li class="method">
109
+ <a href="FlickrawObjects/Photo.html#method-i-id">#id</a>
110
+ &mdash;
111
+ <span class="container">FlickrawObjects::Photo</span>
112
+
113
+ <li class="method">
114
+ <a href="FlickrawObjects/Photoset.html#method-i-id">#id</a>
115
+ &mdash;
116
+ <span class="container">FlickrawObjects::Photoset</span>
117
+
118
+ <li class="method">
119
+ <a href="FlickrawObjects/Photo.html#method-i-medium_800">#medium_800</a>
120
+ &mdash;
121
+ <span class="container">FlickrawObjects::Photo</span>
122
+
123
+ <li class="method">
124
+ <a href="FlickrawObjects/Photo.html#method-i-original">#original</a>
125
+ &mdash;
126
+ <span class="container">FlickrawObjects::Photo</span>
127
+
128
+ <li class="method">
129
+ <a href="FlickrawObjects/Person.html#method-i-photos">#photos</a>
130
+ &mdash;
131
+ <span class="container">FlickrawObjects::Person</span>
132
+
133
+ <li class="method">
134
+ <a href="FlickrawObjects/Photoset.html#method-i-photos">#photos</a>
135
+ &mdash;
136
+ <span class="container">FlickrawObjects::Photoset</span>
137
+
138
+ <li class="method">
139
+ <a href="FlickrawObjects/Person.html#method-i-photosets">#photosets</a>
140
+ &mdash;
141
+ <span class="container">FlickrawObjects::Person</span>
142
+
143
+ <li class="method">
144
+ <a href="FlickrawObjects/Photoset.html#method-i-primary">#primary</a>
145
+ &mdash;
146
+ <span class="container">FlickrawObjects::Photoset</span>
147
+
148
+ <li class="method">
149
+ <a href="FlickrawObjects/Person.html#method-i-professional">#professional</a>
150
+ &mdash;
151
+ <span class="container">FlickrawObjects::Person</span>
152
+
153
+ <li class="method">
154
+ <a href="FlickrawObjects/Photo.html#method-i-public">#public</a>
155
+ &mdash;
156
+ <span class="container">FlickrawObjects::Photo</span>
157
+
158
+ <li class="method">
159
+ <a href="FlickrawObjects/Person.html#method-i-realname">#realname</a>
160
+ &mdash;
161
+ <span class="container">FlickrawObjects::Person</span>
162
+
163
+ <li class="method">
164
+ <a href="FlickrawObjects/Photo.html#method-i-secret">#secret</a>
165
+ &mdash;
166
+ <span class="container">FlickrawObjects::Photo</span>
167
+
168
+ <li class="method">
169
+ <a href="FlickrawObjects/Photo.html#method-i-small_320">#small_320</a>
170
+ &mdash;
171
+ <span class="container">FlickrawObjects::Photo</span>
172
+
173
+ <li class="method">
174
+ <a href="FlickrawObjects/Photo.html#method-i-square">#square</a>
175
+ &mdash;
176
+ <span class="container">FlickrawObjects::Photo</span>
177
+
178
+ <li class="method">
179
+ <a href="FlickrawObjects/Photo.html#method-i-thumbnail">#thumbnail</a>
180
+ &mdash;
181
+ <span class="container">FlickrawObjects::Photo</span>
182
+
183
+ <li class="method">
184
+ <a href="FlickrawObjects/Photo.html#method-i-url_medium">#url_medium</a>
185
+ &mdash;
186
+ <span class="container">FlickrawObjects::Photo</span>
187
+ </ul>
188
+ </main>
189
+
190
+
191
+ <footer id="validator-badges" role="contentinfo">
192
+ <p><a href="http://validator.w3.org/check/referer">Validate</a>
193
+ <p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.1.
194
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
195
+ </footer>
196
+
@@ -37,15 +37,21 @@ module FlickrawObjects
37
37
  @get_info ||= flickr.people.getInfo user_id: id
38
38
  end
39
39
 
40
-
40
+ ##
41
41
  attribute :id
42
+ ##
42
43
  attribute :username
43
44
 
44
45
  attribute_source :get_info
46
+ ##
45
47
  attribute :realname, path: [:realname]
48
+ ##
46
49
  attribute :photos_count, type: Integer, path: [:photos, :count]
50
+ ##
47
51
  attribute :professional, type: Boolean, path: [:ispro]
52
+ ##
48
53
  attribute :first_date_taken ,type: Time, path: [:photos, :firstdatetaken]
54
+ ##
49
55
  attribute :first_date, type: Time, path: [:firstdate]
50
56
 
51
57
  end
@@ -53,6 +59,10 @@ module FlickrawObjects
53
59
  class Photoset
54
60
  include Attributes
55
61
 
62
+ def self.find_by_id(id)
63
+ Photoset.new(flickr.photosets.getInfo photoset_id: id)
64
+ end
65
+
56
66
  def get_photos(params = {})
57
67
  result = Array.new
58
68
  response = flickr.photosets.getPhotos(photoset_id: id)
@@ -64,51 +74,68 @@ module FlickrawObjects
64
74
 
65
75
  alias photos get_photos
66
76
 
67
- def get_info
77
+ def get_info()
68
78
  @get_info ||= flickr.photosets.getInfo photoset_id: id
69
79
  end
70
80
 
81
+ ##
71
82
  attribute :id
83
+ ##
72
84
  attribute :title
85
+ ##
73
86
  attribute :description
74
87
 
75
88
  attribute_source :get_info
89
+ ##
76
90
  attribute :primary
77
91
 
78
-
79
92
  end
80
93
 
81
94
  class Photo
82
95
  include Attributes
96
+
97
+ def self.find_by_id(id)
98
+ Photo.new(flickr.photos.getInfo photo_id: id)
99
+ end
100
+
101
+ ##
83
102
  attribute :id
103
+ ##
84
104
  attribute :owner
105
+ ##
85
106
  attribute :secret
107
+ ##
86
108
  attribute :server
109
+ ##
87
110
  attribute :farm
111
+ ##
88
112
  attribute :title
113
+ ##
89
114
  attribute :public, type: Boolean, path: [:ispublic]
115
+ ##
90
116
  attribute :friend, type: Boolean, path: [:isfriend]
117
+ ##
91
118
  attribute :family, type: Boolean, path: [:isfamily]
92
119
 
93
120
  def url_medium
94
121
  FlickRaw.url(init)
95
122
  end
96
123
 
97
- def self.url(letter, meaning)
124
+ def self.url(meaning, letter)
98
125
  define_method("url_#{meaning}") do
99
126
  FlickRaw.send("url_#{letter}", init)
100
127
  end
101
128
  end
102
129
 
103
- url :s , :square
104
- url :q , :large_square
105
- url :t , :thumbnail
106
- url :m , :small
107
- url :n , :small_320
108
- url :z , :medium_640
109
- url :c , :medium_800
110
- url :b , :large
111
- url :o , :original
130
+ url :square, :s
131
+ url :large_square, :q
132
+ url :thumbnail, :t
133
+ url :small, :m
134
+ url :small_320, :n
135
+ url :medium_640, :z
136
+ url :medium_800, :c
137
+ url :large, :b
138
+ url :original, :o
112
139
 
113
140
  end
114
141
 
@@ -1,7 +1,7 @@
1
1
  require "flickraw_objects/version"
2
- require 'date'
3
- require "flickraw_objects/configuration"
4
2
  require "flickraw_objects/attributes"
3
+ require "flickraw"
4
+ require 'date'
5
5
 
6
6
  module FlickrawObjects
7
7
 
@@ -13,11 +13,7 @@ module FlickrawObjects
13
13
  Person.new(response)
14
14
  end
15
15
 
16
- def get_info
17
- @get_info ||= flickr.people.getInfo user_id: id
18
- end
19
-
20
- def get_photos
16
+ def get_photos(params = {})
21
17
  result = Array.new
22
18
  response = flickr.people.getPhotos user_id: id
23
19
  response.each do |photo|
@@ -27,93 +23,120 @@ module FlickrawObjects
27
23
  end
28
24
  alias photos get_photos
29
25
 
30
- def get_photosets
31
- PhotoSet.list(id)
26
+ def get_photosets(params = {})
27
+ result = Array.new
28
+ response = flickr.photosets.getList user_id: id
29
+ response.each do |photoset|
30
+ result << Photoset.new(photoset)
31
+ end
32
+ result
32
33
  end
34
+ alias photosets get_photosets
33
35
 
36
+ def get_info
37
+ @get_info ||= flickr.people.getInfo user_id: id
38
+ end
34
39
 
40
+ ##
35
41
  attribute :id
42
+ ##
36
43
  attribute :username
37
44
 
38
45
  attribute_source :get_info
46
+ ##
39
47
  attribute :realname, path: [:realname]
48
+ ##
40
49
  attribute :photos_count, type: Integer, path: [:photos, :count]
50
+ ##
41
51
  attribute :professional, type: Boolean, path: [:ispro]
52
+ ##
42
53
  attribute :first_date_taken ,type: Time, path: [:photos, :firstdatetaken]
54
+ ##
43
55
  attribute :first_date, type: Time, path: [:firstdate]
44
56
 
45
57
  end
46
58
 
47
- class PhotoSet
59
+ class Photoset
48
60
  include Attributes
49
61
 
50
- def self.list(user_id)
51
- result = Array.new
52
- response = flickr.photosets.getList user_id: user_id
53
- response.each do |item|
54
- result << PhotoSet.new(item)
55
- end
56
- result
62
+ def self.find_by_id(id)
63
+ Photoset.new(flickr.photosets.getInfo photoset_id: id)
57
64
  end
58
65
 
59
- def self.find(photoset_id)
60
- info = flickr.photosets.getInfo photoset_id: photoset_id
61
- result = PhotoSet.new(info)
62
- result.get_info = info
63
- result
64
- end
65
-
66
- attr_writer :get_info
67
- def get_info
68
- @get_info ||= flickr.photosets.getInfo photoset_id: id
69
- end
70
-
71
- def get_photos
66
+ def get_photos(params = {})
72
67
  result = Array.new
73
- response = flickr.photosets.getPhotos photoset_id: id
74
- puts response.inspect
75
- response.photo.each do |photo|
68
+ response = flickr.photosets.getPhotos(photoset_id: id)
69
+ response["photo"].each do |photo|
76
70
  result << Photo.new(photo)
77
71
  end
78
72
  result
79
73
  end
74
+
80
75
  alias photos get_photos
81
76
 
77
+ def get_info()
78
+ @get_info ||= flickr.photosets.getInfo photoset_id: id
79
+ end
80
+
81
+ ##
82
82
  attribute :id
83
- attribute :primary
84
- attribute :secret
85
- attribute :server
86
- attribute :photos_count, type: Integer, path: [:count_photos]
87
- attribute :views_count, type: Integer, path: [:count_views]
88
- attribute :comments_count, type: Integer, path: [:count_comments]
89
- attribute :videos_count, type: Integer, path: [:count_videos]
90
- attribute :can_comment, type: Boolean
91
- attribute :created, type: Time, path: [:date_create]
92
- attribute :updated, type: Time, path: [:date_update]
83
+ ##
93
84
  attribute :title
94
- attribute :description
85
+ ##
86
+ attribute :description
95
87
 
96
88
  attribute_source :get_info
97
- attribute :owner
89
+ ##
90
+ attribute :primary
98
91
 
99
92
  end
100
93
 
101
94
  class Photo
102
95
  include Attributes
96
+
97
+ def self.find_by_id(id)
98
+ Photo.new(flickr.photos.getInfo photo_id: id)
99
+ end
100
+
101
+ ##
103
102
  attribute :id
103
+ ##
104
104
  attribute :owner
105
+ ##
105
106
  attribute :secret
107
+ ##
106
108
  attribute :server
109
+ ##
107
110
  attribute :farm
111
+ ##
108
112
  attribute :title
113
+ ##
109
114
  attribute :public, type: Boolean, path: [:ispublic]
115
+ ##
110
116
  attribute :friend, type: Boolean, path: [:isfriend]
117
+ ##
111
118
  attribute :family, type: Boolean, path: [:isfamily]
112
119
 
113
- def url
114
- "http://farm#{farm}.staticflickr.com/#{server}/#{id}_#{secret}.jpg"
120
+ def url_medium
121
+ FlickRaw.url(init)
115
122
  end
116
- end
117
123
 
124
+ def self.url(meaning, letter)
125
+ define_method("url_#{meaning}") do
126
+ FlickRaw.send("url_#{letter}", init)
127
+ end
128
+ end
129
+
130
+ url :square, :s
131
+ url :large_square, :q
132
+ url :thumbnail, :t
133
+ url :small, :m
134
+ url :small_320, :n
135
+ url :medium_640, :z
136
+ url :medium_800, :c
137
+ url :large, :b
138
+ url :original, :o
139
+
140
+ end
118
141
 
119
142
  end