Class: IsoBibItem::DocRelationCollection

Inherits:
Array
  • Object
show all
Defined in:
lib/iso_bib_item/document_relation_collection.rb

Overview

Document relations collection

Instance Method Summary collapse

Methods inherited from Array

#filter

Constructor Details

#initialize(relations) ⇒ DocRelationCollection

Returns a new instance of DocRelationCollection.

Parameters:

  • (Array<Hash{type=>String, identifier=>String}>)


108
109
110
# File 'lib/iso_bib_item/document_relation_collection.rb', line 108

def initialize(relations)
  super relations.map { |r| r.is_a?(Hash) ? DocumentRelation.new(r) : r }
end

Instance Method Details

#replacesArray<IsoBibItem::DocumentRelation>



113
114
115
# File 'lib/iso_bib_item/document_relation_collection.rb', line 113

def replaces
  select { |r| r.type == 'replace' }
end