threetaps_client 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
data/lib/threetaps_client.rb
CHANGED
@@ -20,7 +20,7 @@ module ThreetapsClient
|
|
20
20
|
LOCATIONS_URL = "#{REFERENCE_END_POINT}/locations"
|
21
21
|
LOCATION_LOOKUP_URL = "#{REFERENCE_END_POINT}/locations/lookup"
|
22
22
|
|
23
|
-
attr_accessor :api_key
|
23
|
+
attr_accessor :api_key, :raw_data
|
24
24
|
|
25
25
|
def search(criteria={})
|
26
26
|
request SEARCH_END_POINT, criteria
|
@@ -57,23 +57,18 @@ module ThreetapsClient
|
|
57
57
|
request LOCATION_LOOKUP_URL, :code => code
|
58
58
|
end
|
59
59
|
|
60
|
-
def retvals
|
61
|
-
%w[
|
62
|
-
id account_id source category category_group
|
63
|
-
location external_id external_url heading body
|
64
|
-
timestamp expires language price currency
|
65
|
-
images annotations status immortal deleted
|
66
|
-
].join(',')
|
67
|
-
end
|
68
|
-
|
69
60
|
def default_params
|
70
|
-
{ :auth_token => api_key
|
61
|
+
{ :auth_token => api_key }
|
71
62
|
end
|
72
63
|
|
73
64
|
def request(url, params={})
|
74
65
|
params = default_params.merge params.flatten
|
75
|
-
response = RestClient.get url, :params => params, :accept => :json
|
76
|
-
response
|
66
|
+
response = RestClient.get url, :params => params, :accept => :json, :accept_charset => 'utf-8'
|
67
|
+
JSON.parse(response)
|
68
|
+
end
|
69
|
+
|
70
|
+
def raw_data?
|
71
|
+
!!raw_data
|
77
72
|
end
|
78
73
|
|
79
74
|
def log=(io)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: threetaps_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -123,7 +123,6 @@ files:
|
|
123
123
|
- lib/threetaps_client/core_ext.rb
|
124
124
|
- lib/threetaps_client/core_ext/array.rb
|
125
125
|
- lib/threetaps_client/core_ext/hash.rb
|
126
|
-
- lib/threetaps_client/core_ext/string.rb
|
127
126
|
- lib/threetaps_client/version.rb
|
128
127
|
- threetaps_client.gemspec
|
129
128
|
homepage: http://github.com/phongnh/threetaps_client
|
@@ -141,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
140
|
version: '0'
|
142
141
|
segments:
|
143
142
|
- 0
|
144
|
-
hash: -
|
143
|
+
hash: -308350046033807024
|
145
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
145
|
none: false
|
147
146
|
requirements:
|
@@ -150,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
149
|
version: '0'
|
151
150
|
segments:
|
152
151
|
- 0
|
153
|
-
hash: -
|
152
|
+
hash: -308350046033807024
|
154
153
|
requirements: []
|
155
154
|
rubyforge_project:
|
156
155
|
rubygems_version: 1.8.23
|