options_model 0.0.14 → 0.0.15

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: b4e29ec3194ea217ff7c8a44d06c78bce83298323a7b4f55e590648b3d5da452
4
- data.tar.gz: fff6ee9e90c32c566778effdff07899d2d41255b1ad39244efff2abd3afb4549
3
+ metadata.gz: 7ee56e0e094876f5f6fb3723a82fd4c79627cdda6742342616f20a5731fbb035
4
+ data.tar.gz: 714beb4750c2e2df82f177d493f80d4eb98f63b9e18a7810ab31683d983aecdb
5
5
  SHA512:
6
- metadata.gz: e32035b0d90328dc8df7974224b2b244fbe0690cbd121a83a03e0c0b931657e10e06eda4ab6a0f955225d915829172ff599211d2b33bfd95f3776589ea0eff1d
7
- data.tar.gz: 7f292be9bde0d3c61826e87ae20a2ed4d7b99743d10f85c6c3992db0476deb84d13488d1ce5b45c017cf136dfc7d85ce3a933e8184c6883d38c8731c2324e562
6
+ metadata.gz: 070df1ab19f2437e53761cfc0c26418a4f3fa133d6ad9fbcebc5295086843f0d9f9777385fc73278dd58d5ba4bec9ff51e4e77bd0217f4517375e1634762766a
7
+ data.tar.gz: 0671f07b1d7d5f66e9fa96d9bdbb730b9d46340f3ed00664e1397101ae383b530512734fdf9934830114017c6fd8987b49d2df86678e3f25900d4a3216a630fa
@@ -35,7 +35,7 @@ module OptionsModel
35
35
  return new unless yaml
36
36
  return new unless yaml.is_a?(String) && /^---/.match?(yaml)
37
37
 
38
- hash = YAML.safe_load(yaml) || {}
38
+ hash = YAML.safe_load(yaml, permitted_classes: permitted_attribute_classes) || {}
39
39
 
40
40
  unless hash.is_a? Hash
41
41
  raise ArgumentError,
@@ -52,6 +52,10 @@ module OptionsModel
52
52
  def with_unused_attributes?
53
53
  @with_unused_attributes
54
54
  end
55
+
56
+ def permitted_attribute_classes
57
+ @permitted_attribute_classes ||= []
58
+ end
55
59
  end
56
60
  end
57
61
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OptionsModel
4
- VERSION = "0.0.14"
4
+ VERSION = "0.0.15"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: options_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - jasl