policymap_wrap 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -2
- data/VERSION +1 -1
- data/lib/policymap_wrap/client.rb +2 -2
- data/lib/policymap_wrap/connection.rb +6 -1
- data/lib/policymap_wrap.rb +1 -1
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= PolicyMap Wrap
|
2
2
|
|
3
|
-
Ruby wrapper around the PolicyMap API.
|
3
|
+
Ruby wrapper around the PolicyMap API. Uses the YAJL library for fast JSON decoding.
|
4
4
|
|
5
5
|
== Notes
|
6
6
|
|
@@ -10,7 +10,7 @@ PolicyMap APIs are custom designed, so your mileage may vary depending on your A
|
|
10
10
|
|
11
11
|
Before you can perform searches, you must first setup your PolicyMap credentials:
|
12
12
|
|
13
|
-
PolicyMap::Client.set_credentials(<account_id>)
|
13
|
+
PolicyMap::Client.set_credentials(<account_id>, <username>, <password>)
|
14
14
|
|
15
15
|
There are three types of searches: query, boundary and indicator.
|
16
16
|
Each search is performed as follows, respectively:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -25,9 +25,9 @@ module PolicyMap
|
|
25
25
|
|
26
26
|
class << self
|
27
27
|
|
28
|
-
def set_credentials(client_id)
|
28
|
+
def set_credentials(client_id, username, password)
|
29
29
|
@@default_options = { :id => client_id, :ty => 'data', :f => 'j' }
|
30
|
-
@@connection = Connection.new(client_id)
|
30
|
+
@@connection = Connection.new(client_id, username, password)
|
31
31
|
@@connection.debug = @@debug
|
32
32
|
true
|
33
33
|
end
|
@@ -5,8 +5,10 @@ module PolicyMap
|
|
5
5
|
attr_accessor :debug
|
6
6
|
attr_reader :client_id
|
7
7
|
|
8
|
-
def initialize(client_id)
|
8
|
+
def initialize(client_id, username, password)
|
9
9
|
@client_id = client_id
|
10
|
+
@username = username
|
11
|
+
@password = password
|
10
12
|
@debug = false
|
11
13
|
end
|
12
14
|
|
@@ -106,6 +108,9 @@ module PolicyMap
|
|
106
108
|
end
|
107
109
|
end
|
108
110
|
|
111
|
+
@http_client.username = @username
|
112
|
+
@http_client.password = @password
|
113
|
+
|
109
114
|
@http_client.perform
|
110
115
|
|
111
116
|
Response.new(@http_client)
|
data/lib/policymap_wrap.rb
CHANGED
@@ -8,7 +8,7 @@ require 'policymap_wrap/hash_utils'
|
|
8
8
|
require 'policymap_wrap/client'
|
9
9
|
|
10
10
|
module PolicyMap
|
11
|
-
REALM = "http://
|
11
|
+
REALM = "http://www.policymap.com"
|
12
12
|
VERSION = File.read(File.join(File.dirname(__FILE__), '..', 'VERSION'))
|
13
13
|
|
14
14
|
class PolicyMapError < StandardError; end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: policymap_wrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mauricio Gomes
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07
|
18
|
+
date: 2010-08-07 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|