tagalys 0.0.7 → 0.0.8
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 +19 -4
- data/lib/tagalys/configuration.rb +11 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edd123d806a0f779666bc68b802d39cfe52302f5
|
4
|
+
data.tar.gz: cb7cc44fa17ca389b838dc3ab30085944313f61e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c471d89d92ac531d7ee39627a694c8239f2d83fb20656bc1188c2fd1513fbafcdff18ef941e45b91636011791065fe883f7c119f54d61f7206b978b71b34c64
|
7
|
+
data.tar.gz: b900680a514f96a5d12bb2d443f739ac3b38f47afd41eeef2864af09be6ee66f13b7a7d1334224d01b084516d0704f6084aac722a61454d81bdd13b7b05db7bd
|
data/lib/tagalys.rb
CHANGED
@@ -1,9 +1,24 @@
|
|
1
|
-
|
1
|
+
require 'tagalys/configuration'
|
2
|
+
|
3
|
+
module Tagalys
|
2
4
|
class << self
|
5
|
+
attr_accessor :configuration
|
3
6
|
require 'net/http'
|
4
7
|
require 'uri'
|
5
8
|
require 'json'
|
6
9
|
|
10
|
+
def configuration
|
11
|
+
@configuration ||= Configuration.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def reset
|
15
|
+
@configuration = Configuration.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def configure
|
19
|
+
yield(configuration)
|
20
|
+
end
|
21
|
+
|
7
22
|
def search(query=nil, filters=nil)
|
8
23
|
return { status: "Either query or filter should be present" } if query == nil && filters == nil
|
9
24
|
return { status: "Filter should be a hash" } if filters && filters.class != Hash
|
@@ -68,9 +83,9 @@ class Tagalys
|
|
68
83
|
|
69
84
|
def identification
|
70
85
|
{
|
71
|
-
client_code:
|
72
|
-
store_id:
|
73
|
-
api_key:
|
86
|
+
client_code: configuration.client_code,
|
87
|
+
store_id: configuration.store_id,
|
88
|
+
api_key: configuration.api_key
|
74
89
|
}
|
75
90
|
end
|
76
91
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tagalys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anbazhagan Palani
|
@@ -17,6 +17,7 @@ extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
19
|
- lib/tagalys.rb
|
20
|
+
- lib/tagalys/configuration.rb
|
20
21
|
homepage: https://github.com/commutatus/tagalys
|
21
22
|
licenses:
|
22
23
|
- MIT
|