Sha256: 92af00f3d9c566f68b6d3a6a4f4030c38bf6c94e34c4a19bfd6985def9b38336

Contents?: true

Size: 720 Bytes

Versions: 25

Compression:

Stored size: 720 Bytes

Contents

# frozen_string_literal: true

module RelatonBib
  # Document relation collection
  class DocRelationCollection < Array
    # @param relation [Array<RelatonBib::DocumentRelation, Hash>]
    # @option relation [String] :type
    # @option relation [String] :identifier
    # @option relation [String, NIllClass] :url (nil)
    # @option relation [Array<RelatonBib::BibItemLocality>] :bib_locality
    # @option relation [RelatonBib::BibliographicItem, NillClass] :bibitem (nil)
    def initialize(relation)
      super relation.map { |r| r.is_a?(Hash) ? DocumentRelation.new(r) : r }
    end

    # @return [Array<RelatonBib::DocumentRelation>]
    def replaces
      select { |r| r.type == "replace" }
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
relaton-bib-0.9.2 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.9.1 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.9.0 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.8.1 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.8.0 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.7.0 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.6.0 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.5.2 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.5.1 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.5.0 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.4.1 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.4.0 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.3.12 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.3.11 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.3.10 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.3.9 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.3.8 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.3.7 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.3.6 lib/relaton_bib/document_relation_collection.rb
relaton-bib-0.3.5 lib/relaton_bib/document_relation_collection.rb