mosaic-foursquare 0.2.1 → 0.2.2
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.
- checksums.yaml +8 -8
- data/lib/mosaic/foursquare/photo.rb +6 -1
- data/lib/mosaic/foursquare/version.rb +1 -1
- data/spec/foursquare/photo_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzhiMjBkNTQ5YWIwYTA4Y2I1ZmM4YTJlYjQ4ODE0ZjU2OGM0OTk4MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGE3MTIxMmVjZTQ0NGU2ZTU2MzA0NjcxNzVjMDc2NWZiMWQwMGUzMA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGU1ODBkOTE5MDUzMmQwYTk0NTMwOWI1NDI0ZjRlM2RkYTEyMmI2ZDdlYjhl
|
10
|
+
YTJkMDU0MWUzMWI2NWFiOGZkMmIyNTViZWU4Mjk1ZDhlY2QwZDBkMTU1MDJl
|
11
|
+
MmQwOGZlZDlhZTg2MzhmNTkyMmVkYzYwNzAwY2VkMmZiMWQwZTE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzFmNWRlMDUyODc5MDMxNTgyYmY0ZWRiNjc1ODRhZTcyNTZlMTZjMzk1Nzky
|
14
|
+
N2Y0YTk5OTM3MmExOTg2MWEwOWQyMzgzNDIxNWQxN2JmNzA3MjhlMTFlNmYy
|
15
|
+
YjYxYjYzYzY3MDNiYTFjZDc5YjMzNmExODcyYTEyN2E3OTdkYzQ=
|
@@ -3,7 +3,12 @@ require 'mosaic/foursquare/object'
|
|
3
3
|
module Mosaic
|
4
4
|
module Foursquare
|
5
5
|
class Photo < Mosaic::Foursquare::Object
|
6
|
-
attr_accessor :id, :url, :visibility
|
6
|
+
attr_accessor :id, :url, :visibility, :user
|
7
|
+
|
8
|
+
def initialize(options = {})
|
9
|
+
super
|
10
|
+
self.user &&= Mosaic::Foursquare::User.new(user)
|
11
|
+
end
|
7
12
|
|
8
13
|
def url(size = "original")
|
9
14
|
@url ||= @prefix.to_s + size + @suffix.to_s
|
@@ -21,6 +21,11 @@ describe Mosaic::Foursquare::Photo, :vcr => {:cassette_name => 'Venue/shared'} d
|
|
21
21
|
expect(photo.url).to eql("https://irs2.4sqi.net/img/general/original/photopath.jpg")
|
22
22
|
end
|
23
23
|
|
24
|
+
it "should have the author of the photo as the user argument, and load their profile picture" do
|
25
|
+
expect(photo.user).to be_an_instance_of(Mosaic::Foursquare::User)
|
26
|
+
expect(photo.user.photo).to be_an_instance_of(Mosaic::Foursquare::Photo)
|
27
|
+
end
|
28
|
+
|
24
29
|
it "should pass arguments into the url" do
|
25
30
|
expect(photo.url("300x500")).to eql("https://irs2.4sqi.net/img/general/300x500/photopath.jpg")
|
26
31
|
end
|