usabilla_api 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f13c35ae8417fa8b4b41581e65b0bb07a48b28e2
4
- data.tar.gz: b619e2e61b5561465ddd422b3ebf20c11881c5f7
3
+ metadata.gz: 6ab9ee5f48a68b85da16ceba8fa24ac83965c3c2
4
+ data.tar.gz: cb4d01d5f6f88cf8cf1bf3c7a7a510c7caf15aa5
5
5
  SHA512:
6
- metadata.gz: 157ad4385c43a9819713a1f0f03235d3012d68476adea0ccc201f1daa1ee75470c67c183225a46ebf0a6638134e2a216ecd2f6926ed391540ab365f8eca0cda7
7
- data.tar.gz: 45246ed9e9e49572b350d39dd947a78abe76a7f584c38357087d26de5efa3a5a1bd5aadf1a554ada54c0ebd16f172ff579b8e7bea2b82b4bcb6a725a5910652d
6
+ metadata.gz: 60f636ffe0da8712bde51839450c08bbd5a158a76e3583327a81a81a2b2f217fc303b84b6cc8514dc5f8e5cf159bf93365f0d43247c7e4c71bed70893bd04b58
7
+ data.tar.gz: 8689e92b81e5a43409dcc7d84be90903393b8c0ace3bc5097c2135c54988dc5df37d6b4ee1baf4fca1b903f4f170153e1867a1dea09ef4800ea049f99a61bcee
data/CHANGELOG.md CHANGED
@@ -3,6 +3,8 @@ Version History
3
3
  * All version update notes will be included here.
4
4
  ----
5
5
 
6
+ * **1.1.1** Clean up JSON.parse.
7
+ * **1.1.0** Removed json response flag as it is unnecessary for Rails/Sinatra integration. Simply adding .to_json on a proper json respond_to will yield the same results.
6
8
  * **1.0.1** Adjust Query String for proper routing.
7
9
  * **1.0.0** 100% Testing Included. Refactoring to the way you call convenience functions has changed, you must now change
8
10
  your previous function calls to what has been updated in the [Readme file](https://github.com/JMolinaro/usabilla_api/blob/master/README.md) under Usage.
data/README.md CHANGED
@@ -6,6 +6,8 @@ gem 'usabilla_api'
6
6
  ```
7
7
  Run the bundle command to install it.
8
8
 
9
+ [Example Rails App](https://github.com/JMolinaro/usabilla_api_example)
10
+
9
11
  #Configuration
10
12
 
11
13
  ######Add these lines to the appropriate config/environments file
@@ -18,10 +20,6 @@ UsabillaApi.configuration.secret_key = 'YOUR-SECRET-KEY'
18
20
  ```
19
21
  Get your access and secret key here: [Usabilla Member API](https://usabilla.com/member/api)
20
22
 
21
- You can either return an Object (default) or a the original JSON string.
22
- ```
23
- UsabillaApi.configuration.json_response = true
24
- ```
25
23
  Full Usabilla API documentation: [Usabilla API](https://usabilla.com/api)
26
24
 
27
25
  #Usage
@@ -56,11 +54,12 @@ end
56
54
  ```
57
55
  # View /show.html.erb
58
56
  <h2>Buttons</h2>
59
- <% @buttons.each do |button| %>
57
+ <% @buttons.items.each do |button| %>
60
58
  Button ID: <%= button.id %>
61
59
  Button Name: <%= button.name %>
62
60
  <% end %>
63
61
  ```
62
+ [Example Rails App](https://github.com/JMolinaro/usabilla_api_example)
64
63
 
65
64
  ######Accepted Query String Parameters
66
65
 
@@ -1,19 +1,17 @@
1
- require 'json'
2
-
3
1
  module UsabillaApi
4
2
  module Clients
5
3
  class Button
6
4
  class << self
7
5
 
8
6
  def retrieve(params)
9
- request = JSON.parse(UsabillaApi.api_client.new(params).get_buttons)
7
+ request = UsabillaApi.api_client.new(params).get_buttons
10
8
  response = UsabillaApi.response.new(request)
11
9
  response.items = response.items.map {|item| UsabillaApi::Models::Button::Item.new(item)} unless response.items.nil?
12
10
  response
13
11
  end
14
12
 
15
13
  def feedback(params)
16
- request = JSON.parse(UsabillaApi.api_client.new(params).get_feedback_items)
14
+ request = UsabillaApi.api_client.new(params).get_feedback_items
17
15
  response = UsabillaApi.response.new(request)
18
16
  response.items = response.items.map {|item| UsabillaApi::Models::Feedback::Item.new(item)} unless response.items.nil?
19
17
  response
@@ -1,19 +1,17 @@
1
- require 'json'
2
-
3
1
  module UsabillaApi
4
2
  module Clients
5
3
  class Campaign
6
4
  class << self
7
5
 
8
6
  def retrieve(params)
9
- request = JSON.parse(UsabillaApi.api_client.new(params).get_campaigns)
7
+ request = UsabillaApi.api_client.new(params).get_campaigns
10
8
  response = UsabillaApi.response.new(request)
11
9
  response.items = response.items.map {|item| UsabillaApi::Models::Campaign::Item.new(item)} unless response.items.nil?
12
10
  response
13
11
  end
14
12
 
15
13
  def results(params)
16
- request = JSON.parse(UsabillaApi.api_client.new(params).get_campaign_results)
14
+ request = UsabillaApi.api_client.new(params).get_campaign_results
17
15
  response = UsabillaApi.response.new(request)
18
16
  response.items = response.items.map {|item| UsabillaApi::Models::CampaignResults::Item.new(item)} unless response.items.nil?
19
17
  response
@@ -1,5 +1,6 @@
1
1
  require 'rest-client'
2
2
  require 'openssl'
3
+ require 'json'
3
4
 
4
5
  module UsabillaApi
5
6
 
@@ -76,7 +77,7 @@ module UsabillaApi
76
77
 
77
78
  # Send the request.
78
79
  request_url = uri + '?' + query_string
79
- response = RestClient.get(UsabillaApi.configuration.base_uri + request_url, headers)
80
+ response = JSON.parse(RestClient.get(UsabillaApi.configuration.base_uri + request_url, headers))
80
81
 
81
82
  # Return Response
82
83
  response
@@ -1,3 +1,3 @@
1
1
  module UsabillaApi
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usabilla_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Molinaro