Class: IsoBibItem::BibItemLocality
- Inherits:
-
Object
- Object
- IsoBibItem::BibItemLocality
- Defined in:
- lib/iso_bib_item/document_relation_collection.rb
Overview
Bibliographic item locality.
Instance Attribute Summary collapse
- #reference_from ⇒ IsoBibItem::LocalizedString readonly
- #reference_to ⇒ IsoBibItem::LocalizedString readonly
- #type ⇒ IsoBibItem::SpecificLocalityType readonly
Instance Method Summary collapse
-
#initialize(type, reference_from, reference_to = nil) ⇒ BibItemLocality
constructor
A new instance of BibItemLocality.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(type, reference_from, reference_to = nil) ⇒ BibItemLocality
Returns a new instance of BibItemLocality.
47 48 49 50 51 |
# File 'lib/iso_bib_item/document_relation_collection.rb', line 47 def initialize(type, reference_from, reference_to = nil) @type = type @reference_from = reference_from @reference_to = reference_to end |
Instance Attribute Details
#reference_from ⇒ IsoBibItem::LocalizedString (readonly)
39 40 41 |
# File 'lib/iso_bib_item/document_relation_collection.rb', line 39 def reference_from @reference_from end |
#reference_to ⇒ IsoBibItem::LocalizedString (readonly)
42 43 44 |
# File 'lib/iso_bib_item/document_relation_collection.rb', line 42 def reference_to @reference_to end |
#type ⇒ IsoBibItem::SpecificLocalityType (readonly)
36 37 38 |
# File 'lib/iso_bib_item/document_relation_collection.rb', line 36 def type @type end |
Instance Method Details
#to_xml(builder) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/iso_bib_item/document_relation_collection.rb', line 53 def to_xml(builder) builder.locality(type: type) do builder.referenceFrom { reference_from.to_xml(builder) } builder.referenceTo reference_to if reference_to end end |