promoqui-api-sdk 1.1.1 → 1.1.2

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: b2bc4b2124907d68d6e5a6cf455f8ba90b9ce052
4
- data.tar.gz: 70f6b7c8e1ffedb5a07f3c5c4f06bf1b600cb8d4
3
+ metadata.gz: ba21f3fac04a57878a4e8992dd317aadcf31c6b3
4
+ data.tar.gz: 2eece5cfe4bcd0fa6818886e8c89764de0fff95d
5
5
  SHA512:
6
- metadata.gz: f183fc4eb0b0c9d489a49a353a304ea39944560ea2e8684fe0c3835b5ec4f05a870fdcddddb5a11d967823a5236a8f433173295ce2ac70adf35e49aa1b5da387
7
- data.tar.gz: 396bb6e75a971ab81486d0b181d6f232323b3c9863557da0a75ed6c52d21a391ddb7549a2d6e2c5ace485c467c258d28c3efa2b73814226d3c920f44a7811a66
6
+ metadata.gz: a62b251ee56a5451898286b3731b50ed9bb3368a0a778b43cf850f62dde70a755a2e3ce257c5207510647281c2e9ac3481516b0c7120fb9a7cc2fd97993ce390
7
+ data.tar.gz: 030e1b2d4ff73c50100a4422c24f670c4450d74c31d3669502eb530a314a3fbcb7a2486327dd13fd0cdfd71369b3ad30501ae588d032f695054ca3ead0089d6c
data/lib/pqsdk/leaflet.rb CHANGED
@@ -2,6 +2,10 @@ module PQSDK
2
2
  class Leaflet
3
3
  attr_accessor :id, :name, :url, :start_date, :end_date, :pdf_data, :image_urls
4
4
 
5
+ def initialize
6
+ self.image_urls = []
7
+ end
8
+
5
9
  def self.find(url)
6
10
  res = RestLayer.get('v1/leaflets', { url: url }, { 'Authorization' => "Bearer #{Token.access_token}" })
7
11
  if res[0] == 200
@@ -24,7 +28,7 @@ module PQSDK
24
28
  fields['start_date'] = start_date unless start_date.nil?
25
29
  fields['end_date'] = end_date unless end_date.nil?
26
30
  fields['pdf_data'] = pdf_data unless pdf_data.nil?
27
- fields['image_urls'] = image_urls if image_urls.any?
31
+ fields['image_urls'] = image_urls.try(:to_json) || []
28
32
 
29
33
  res = RestLayer.send(method, endpoint, fields, { 'Authorization' => "Bearer #{Token.access_token}" })
30
34
 
data/lib/pqsdk/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PQSDK
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promoqui-api-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Boffa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-05 00:00:00.000000000 Z
11
+ date: 2015-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json