tagalys 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tagalys.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2e72df51daa269cd33b10d8fa008201c3a16080be3af3b416bcc0a8f7cd2600
|
4
|
+
data.tar.gz: 5164f8d5e0570a38471e7249ecc0ec223d2b8933aebcc6be4ec5986e4114f189
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79db5d9ce01f147f80a7e89777dcde9bfd126834573afa0a432a74c443270b27d89c54699fda406ed3c4775fbbc8c8b1cbcba01d2fa165d7e48f0176c1d7df70
|
7
|
+
data.tar.gz: 233f2a30a3135367643959ce43251dfdaf45e3b516a42b210a72953af0bb28c4d4243af3cc75baa72224f1f117a8be0e4bf90252bacd946b361ad5d719b3f418
|
data/lib/tagalys.rb
CHANGED
@@ -19,13 +19,15 @@ module Tagalys
|
|
19
19
|
yield(configuration)
|
20
20
|
end
|
21
21
|
|
22
|
-
def search(query=nil, filters=nil)
|
22
|
+
def search(query=nil, filters=nil, page=1, per_page=30)
|
23
23
|
return { status: "Either query or filter should be present" } if query == nil && filters == nil
|
24
24
|
return { status: "Filter should be a hash" } if filters && filters.class != Hash
|
25
25
|
request_body = {
|
26
26
|
identification: identification,
|
27
27
|
q: query.strip.length > 0 ? query : nil,
|
28
28
|
qf: filters,
|
29
|
+
page: page,
|
30
|
+
per_page: per_page,
|
29
31
|
request: [
|
30
32
|
"total",
|
31
33
|
"results",
|
@@ -51,10 +53,12 @@ module Tagalys
|
|
51
53
|
search_response = request_tagalys('/mpages/' + page_name, request_body)
|
52
54
|
end
|
53
55
|
|
54
|
-
def get_page_list
|
56
|
+
def get_page_list(page=1, per_page=30)
|
55
57
|
request_body = {
|
56
58
|
identification: identification,
|
57
|
-
request: ["url_component", "variables"]
|
59
|
+
request: ["url_component", "variables"],
|
60
|
+
page: page,
|
61
|
+
per_page: per_page
|
58
62
|
}.compact
|
59
63
|
search_response = request_tagalys('/mpages/', request_body)
|
60
64
|
end
|