sec_api 1.0.0 → 1.0.4

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: f33a11ec3b8cf4f6ab7cb5e484fa24f88e5446630868f67702b1ab1336011951
4
- data.tar.gz: 5d67a99ce1490136471f4a20346d57c506ea0bc75ac8ac03280f3d2690482a71
3
+ metadata.gz: 124de69867f417e8c8db8630af582c2b12272f71e7daa0a08265d6c260ba8c4f
4
+ data.tar.gz: f0bd3f3b9ba8e856965c8c3aea0c2a22bc99b4b37326b424ba25198d4580702d
5
5
  SHA512:
6
- metadata.gz: a4acdf281ce2fb6345f1cbdd52c950d8602de26816fe0437cb4d40ee6502a74cd35e31b81d864cdef8f2f5c36ba3e4d5500d056dc3ce761bc390f3c72afec676
7
- data.tar.gz: d7f8800563146e2a47979364fd9f3d0302502927a201def6b37b99745b07a6b9603b5390bdefcf8afc30c1d5983faf889a9d01ef87d8a4d9db2393a998a56fa9
6
+ metadata.gz: 15d43787bb823f4d6e560389bb4088b1297f1440a9b2b4e046a422062f949c324f7a3e97f13e717e45677f1344658d64c2e3fc122e7a73b03d15913b16156344
7
+ data.tar.gz: 3ace738274c2ed903da7536582acd328fcd6740a431005d1c6bad0b232dc1395ad7029c2087d8b4ce9a5fadf614d0cc40b61015eb204c88b8b8454884b01c90c
@@ -26,7 +26,7 @@ module SecApi
26
26
  attribute? :description, Types::String
27
27
  attribute :type, Types::String
28
28
  attribute :url, Types::String
29
- attribute :size, Types::Coercible::Integer
29
+ attribute? :size, Types::Coercible::Integer.optional
30
30
 
31
31
  # Creates a DocumentFormatFile from API response data.
32
32
  #
@@ -38,6 +38,14 @@ module SecApi
38
38
  def self.from_api(data)
39
39
  data[:url] = data.delete(:documentUrl) if data.key?(:documentUrl)
40
40
 
41
+ # API sometimes returns whitespace (including non-breaking spaces) for size
42
+ # Use POSIX [[:space:]] to match all unicode whitespace including NBSP
43
+ [:size, "size"].each do |key|
44
+ if data.key?(key) && data[key].is_a?(String) && data[key].match?(/\A[[:space:]]*\z/)
45
+ data.delete(key)
46
+ end
47
+ end
48
+
41
49
  new(data)
42
50
  end
43
51
  end
@@ -61,8 +61,8 @@ module SecApi
61
61
  attribute :form_type, Types::String
62
62
 
63
63
  # @!attribute [r] period_of_report
64
- # @return [String] reporting period end date
65
- attribute :period_of_report, Types::String
64
+ # @return [String, nil] reporting period end date (may be nil for some filing types)
65
+ attribute? :period_of_report, Types::String.optional
66
66
 
67
67
  # @!attribute [r] filed_at
68
68
  # @return [Date] filing date (automatically coerced from string via Dry::Types)
@@ -31,7 +31,7 @@ module SecApi
31
31
  MINOR = 0
32
32
 
33
33
  # @return [Integer] Patch version number (bug fixes)
34
- PATCH = 0
34
+ PATCH = 4
35
35
 
36
36
  # @return [String, nil] Pre-release identifier (e.g., "alpha", "beta", "rc1")
37
37
  PRE = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sec_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lauri Jutila