This repository was archived by the owner on Oct 7, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -17,4 +17,9 @@ def find(id)
17
17
res = @connection . get ( "#{ self . class . type_name } /#{ id } " )
18
18
Creatubbles . instantiate_object_from_response ( res , @connection )
19
19
end
20
+
21
+ def init_objects response
22
+ Creatubbles . instantiate_objects_from_response ( response , @connection )
23
+ end
24
+
20
25
end
Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ class Creatubbles::Contents < Creatubbles::BaseCollection
4
4
5
5
define_type_name 'contents'
6
6
7
+ def index params_hash = { "query" : nil }
8
+ params_hash . stringify_keys! . slice! ( "query" )
9
+ init_objects @connection . get ( "contents?#{ params_hash . to_param } " )
10
+ end
11
+
7
12
def recent
8
13
init_objects @connection . get ( 'contents/recent' )
9
14
end
@@ -20,10 +25,4 @@ def followed
20
25
init_objects @connection . get ( 'contents/followed' )
21
26
end
22
27
23
- private
24
-
25
- def init_objects response
26
- Creatubbles . instantiate_objects_from_response ( response , @connection )
27
- end
28
-
29
28
end
Original file line number Diff line number Diff line change 3
3
class Creatubbles ::Galleries < Creatubbles ::BaseCollection
4
4
5
5
define_type_name 'galleries'
6
+
7
+ def featured
8
+ init_objects @connection . get ( 'featured_galleries' )
9
+ end
10
+
11
+ def owned_by_user user_id
12
+ init_objects @connection . get ( "users/#{ user_id } /galleries" )
13
+ end
14
+
15
+ def mine
16
+ init_objects @connection . get ( "users/me/galleries" )
17
+ end
18
+
19
+ def mine_favorite
20
+ init_objects @connection . get ( "users/me/favorite_galleries" )
21
+ end
22
+
23
+ def containing_creation creation_id
24
+ init_objects @connection . get ( "creations/#{ creation_id } /galleries" )
25
+ end
26
+
6
27
end
You can’t perform that action at this time.
0 commit comments