Class: RelatonBib::LocalityStack

Inherits:
Object
  • Object
show all
Includes:
RelatonBib
Defined in:
lib/relaton_bib/bib_item_locality.rb

Direct Known Subclasses

SourceLocalityStack

Constant Summary

Constants included from RelatonBib

VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RelatonBib

parse_date

Constructor Details

#initialize(locality) ⇒ LocalityStack

Returns a new instance of LocalityStack.

Parameters:



70
71
72
# File 'lib/relaton_bib/bib_item_locality.rb', line 70

def initialize(locality)
  @locality = locality
end

Instance Attribute Details

#localityArray<RelatonBib::Locality> (readonly)



67
68
69
# File 'lib/relaton_bib/bib_item_locality.rb', line 67

def locality
  @locality
end

Instance Method Details

#to_hashObject



82
83
84
# File 'lib/relaton_bib/bib_item_locality.rb', line 82

def to_hash
  { "locality_stack" => single_element_array(locality) }
end

#to_xml(builder) ⇒ Object

Parameters:

  • builder (Nokogiri::XML::Builder)


75
76
77
78
79
# File 'lib/relaton_bib/bib_item_locality.rb', line 75

def to_xml(builder)
  builder.localityStack do |b|
    locality.each { |l| l.to_xml(b) }
  end
end