retentiongrid 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 892f3b7d7a66383fdfae7da935da621d00155b21
4
- data.tar.gz: 1b5e1bc5ceb13d5357d1263afa3ce56d5e94bafe
3
+ metadata.gz: c46c8b19021285df0a40f8227bacc72f2e351244
4
+ data.tar.gz: 81150b36efc5b8429a71cae3e80a0c03308f5e17
5
5
  SHA512:
6
- metadata.gz: 57dd691a5f50ee232404b6397ed985167f4e9ad1a8e393ce8fcd06bd536a46697457bdf98b71ceb545e0379eba40b6c525eb9c938f7fe4d106578871eafaa8aa
7
- data.tar.gz: 5a65f1b4f48bd3be18375840aaf26dfd6050c690b01841d33a1ece176444aa1fcc2e5fce347f816449a769625515f95aaa4403824669b4da9de7a5bc3aa67ca3
6
+ metadata.gz: 214c590b5de8447506031dd303fd811480e71068b79c609a7379e8d9d2b568eb0663a74abad8f9565801cf3278fac65a7c9e50528fced47ad0b3f1be4e9378df
7
+ data.tar.gz: 001b8861a1af6f4b796f86b0077cda67cc3117415061dc8992ba75fe86e12ad8c41b3d05a5b319c084442113b619c8986743e9730f80940f4648f543bf276cf5
@@ -7,7 +7,7 @@ module Retentiongrid
7
7
  ATTRIBUTES_NAMES = [ :product_id, :available, :metadata,
8
8
  :title, :image_url, :currency, :price,
9
9
  :sale_price, :cost_price, :product_url,
10
- :product_created_at, :product_updated_at, :meta
10
+ :product_created_at, :product_updated_at, :metadata
11
11
  ].freeze
12
12
 
13
13
  ATTRIBUTES_NAMES.each do |attrib|
@@ -16,11 +16,14 @@ module Retentiongrid
16
16
 
17
17
  def initialize(attribs={})
18
18
  super
19
- @product_created_at = Time.parse(product_created_at) unless product_created_at.nil?
20
- @product_updated_at = Time.parse(product_updated_at) unless product_updated_at.nil?
19
+ if product_created_at.class == "String" && !product_created_at.nil?
20
+ @product_created_at = Time.parse(product_created_at)
21
+ end
22
+ if @product_updated_at.class == "String" && !product_updated_at.nil?
23
+ @product_updated_at = Time.parse(product_updated_at)
24
+ end
21
25
  end
22
26
 
23
-
24
27
  # API Stuff here
25
28
 
26
29
  # Find a product with given id
@@ -1,3 +1,3 @@
1
1
  module Retentiongrid
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -15,7 +15,7 @@ FactoryGirl.define do
15
15
  image_url 'http://example.com/images/1.png'
16
16
  product_updated_at { Time.now - 86400 }
17
17
  product_created_at { Time.now - 161024 }
18
- meta { Hash.new(
18
+ metadata { Hash.new(
19
19
  type: "red",
20
20
  region: "napa valley",
21
21
  country: "USA",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retentiongrid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christoph Bünte