dugway 0.11.4 → 0.12.0

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
  SHA256:
3
- metadata.gz: 2e81b4e3930ef750316957f494b0273e30a13967d8ffebfb2260f27df91cacb5
4
- data.tar.gz: b44c12243a63daffa8a200e6c6a1637abe2b744bba6013a07fdaaea3c373e25e
3
+ metadata.gz: aa69a92506b519c6dd328f384ab87c65faf9b333668d2343663205497a95cd4c
4
+ data.tar.gz: 7486855a255a217a533480e16a5b4e84984f1e1bb06d2ebe4df8d381f79aae67
5
5
  SHA512:
6
- metadata.gz: aaddbc91105a7c18f56c92c9960597936b6d8262a31bd5f50e6e8623fe454ed6cac7774ab2382a7b36e300170bcd9822687cb0b78e796aec3cf6f0e207db3866
7
- data.tar.gz: cadd5f563a0a5c7f3277069a4ab776dbe7341abd3ffc96cbfea0946ac249de4fa4da6d151c5b04eb4f2d64c7a014e928ffd1fd2dbd894455770188d5e86fcb4d
6
+ metadata.gz: 5bec30a1d3f6553e582150ec9ce3e783b2f2cb0c4f8dbfb03219c060591766449dce91e5817e716d8d40e55786629c3d5312b42b9ee0dd4e57dd5ac251282059
7
+ data.tar.gz: d2789c469c34a62db955bf20c7b11a8842b6b6caac9a76421bddb634023d06a4b7d58e18ad711d5872f92c80c33ad06d3b1a64aa182f4f362930b375df8ea32f
@@ -0,0 +1,24 @@
1
+ module Dugway
2
+ module Drops
3
+ class OptionGroupDrop < BaseDrop
4
+
5
+ def id
6
+ source['id']
7
+ end
8
+
9
+ def name
10
+ source['name']
11
+ end
12
+
13
+ def position
14
+ source['position']
15
+ end
16
+
17
+ def values
18
+ @values ||= source['values'].present? ?
19
+ source['values'].map { |value| OptionGroupValueDrop.new(value) } : []
20
+ end
21
+
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,23 @@
1
+ module Dugway
2
+ module Drops
3
+ class OptionGroupValueDrop < BaseDrop
4
+
5
+ def id
6
+ source['id']
7
+ end
8
+
9
+ def name
10
+ source['name']
11
+ end
12
+
13
+ def position
14
+ source['position']
15
+ end
16
+
17
+ def option_group_id
18
+ source['option_group_id']
19
+ end
20
+
21
+ end
22
+ end
23
+ end
@@ -37,6 +37,15 @@ module Dugway
37
37
  @options_in_stock ||= options.reject { |o| o.sold_out }
38
38
  end
39
39
 
40
+ def has_option_groups
41
+ source['has_option_groups']
42
+ end
43
+
44
+ def option_groups
45
+ @option_groups ||= source['option_groups'].present? ?
46
+ source['option_groups'].map { |group| OptionGroupDrop.new(group) } : []
47
+ end
48
+
40
49
  def shipping
41
50
  @shipping ||= source['shipping'].present? ? source['shipping'].map { |o| ShippingOptionDrop.new(o.update('product' => self)) } : []
42
51
  end
@@ -22,6 +22,11 @@ module Dugway
22
22
  def inventory
23
23
  ((quantity.to_f / (quantity + sold).to_f) * 100).round
24
24
  end
25
+
26
+ def option_group_values
27
+ @option_group_values ||= source['option_group_values'].present? ?
28
+ source['option_group_values'].map { |value| OptionGroupValueDrop.new(value) } : []
29
+ end
25
30
  end
26
31
  end
27
32
  end
@@ -1,3 +1,3 @@
1
1
  module Dugway
2
- VERSION = "0.11.4"
2
+ VERSION = "0.12.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dugway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.4
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Big Cartel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-09 00:00:00.000000000 Z
11
+ date: 2019-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -452,6 +452,8 @@ files:
452
452
  - lib/dugway/liquid/drops/country_drop.rb
453
453
  - lib/dugway/liquid/drops/currency_drop.rb
454
454
  - lib/dugway/liquid/drops/image_drop.rb
455
+ - lib/dugway/liquid/drops/option_group_drop.rb
456
+ - lib/dugway/liquid/drops/option_group_value_drop.rb
455
457
  - lib/dugway/liquid/drops/page_drop.rb
456
458
  - lib/dugway/liquid/drops/pages_drop.rb
457
459
  - lib/dugway/liquid/drops/product_drop.rb
@@ -559,7 +561,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
559
561
  version: '0'
560
562
  requirements: []
561
563
  rubyforge_project:
562
- rubygems_version: 2.7.8
564
+ rubygems_version: 2.7.6
563
565
  signing_key:
564
566
  specification_version: 4
565
567
  summary: Easily build and test Big Cartel themes.