Class: IsoBibItem::DocumentIdentifier

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

Overview

Document identifier.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, type:) ⇒ DocumentIdentifier

Returns a new instance of DocumentIdentifier.



31
32
33
34
# File 'lib/iso_bib_item/bibliographic_item.rb', line 31

def initialize(id:, type:)
  @id   = id
  @type = type
end

Instance Attribute Details

#idString (readonly)

Returns:

  • (String)


26
27
28
# File 'lib/iso_bib_item/bibliographic_item.rb', line 26

def id
  @id
end

#typeString (readonly)

Returns:

  • (String)


29
30
31
# File 'lib/iso_bib_item/bibliographic_item.rb', line 29

def type
  @type
end

Instance Method Details

#to_xml(builder) ⇒ Object

Add docidentifier xml element

Parameters:

  • builder (Nokogiri::XML::Builder)


41
42
43
# File 'lib/iso_bib_item/bibliographic_item.rb', line 41

def to_xml(builder)
  builder.docidentifier(id, type: type)
end