pubid 2.0.0.pre.alpha.61 → 2.0.0.pre.alpha.62

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: c5afd984209314db5f3b13fa48ef4d24e3f90ffb08802b9362fa8e52b66f35af
4
- data.tar.gz: 1fe21dc3bebe7cba7606d7b7df25ea2f2c0277b111193e6e260b2ceb922d3a30
3
+ metadata.gz: e7afdb690b76d32cc60abd371dd8936f0e79054e472150a6ec05f6fea1931fd7
4
+ data.tar.gz: 458c87cedd25491b9022e1053d72a799ec108bf9721d4103df44965b526855f7
5
5
  SHA512:
6
- metadata.gz: 5d3f796d89995bdc9c994fffb5ac713b317c65e1b6ff46c102b4b72ce2ce7078e08ca3ee5471e00c6403b2d18a815df838b420fa124e4229dbe86daee42e9074
7
- data.tar.gz: 5ed1785a22c19d5ffe47ca3733380d8e5bdfb37d66d57c0535866b71f4050a5a95c090ac35cc76403eab5aba4cab67568963f8643a4b414141a46d5160539d22
6
+ metadata.gz: 8d0e50ff1df89fe98825e6427d0a4a0be18d8b74c7ddd396499fcd927f96ecb67c5b6cf4503b0b95ad7ef87f8d6a5463e8793140b4185c9aeb0f4cb5b5aa3244
7
+ data.tar.gz: 774ed8600701853d1fcd875fe589eee063b31ff8b319e0b1ce90d1e42ac8bcc20d18259c1602f9c8fa7c16aeb9bcd1246d151ce1c3086b656e8ff48755c488cf
@@ -1349,10 +1349,25 @@ module Pubid
1349
1349
  end
1350
1350
  end
1351
1351
 
1352
+ # Self is a wrapped record of exactly the edition +other+ names: the
1353
+ # wrapped document resolves to that edition (pubid#580 — a dated
1354
+ # base query must reach the wrapped record of that edition, whose
1355
+ # identity is one level down). Only wrappers answer true: a bare
1356
+ # record is its own edition and is matched directly by ===. The
1357
+ # resolution is exact — the wrapped base must equal the edition the
1358
+ # query names, no wildcards.
1359
+ def wrapped_edition_of?(other)
1360
+ return false unless other.is_a?(::Pubid::Identifier)
1361
+ return false unless wrapped_document
1362
+
1363
+ base_document == other
1364
+ end
1365
+
1352
1366
  # Any relational predicate holds.
1353
1367
  def related_to?(other)
1354
1368
  %i[supplement_of? has_supplement? dated_version_of? edition_of?
1355
- revision_of? sibling_of? includes? draft_of?].any? do |m|
1369
+ revision_of? sibling_of? includes? draft_of?
1370
+ wrapped_edition_of?].any? do |m|
1356
1371
  public_send(m, other)
1357
1372
  end
1358
1373
  end
@@ -70,6 +70,13 @@ module Pubid
70
70
  def typed_stage
71
71
  base&.typed_stage
72
72
  end
73
+
74
+ # The wrapped document the VAP record is a view of (pubid#580):
75
+ # the peel lets a dated base query resolve the edition through
76
+ # the wrapper's relational predicates.
77
+ def base_document
78
+ base&.base_document || base
79
+ end
73
80
  end
74
81
  end
75
82
  end
data/lib/pubid/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pubid
4
- VERSION = "2.0.0.pre.alpha.61"
4
+ VERSION = "2.0.0.pre.alpha.62"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha.61
4
+ version: 2.0.0.pre.alpha.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.