Class: RelatonBib::LocalityStack
- Includes:
- RelatonBib
- Defined in:
- lib/relaton_bib/bib_item_locality.rb
Direct Known Subclasses
Constant Summary
Constants included from RelatonBib
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(locality) ⇒ LocalityStack
constructor
A new instance of LocalityStack.
- #to_hash ⇒ Object
- #to_xml(builder) ⇒ Object
Methods included from RelatonBib
Constructor Details
#initialize(locality) ⇒ LocalityStack
Returns a new instance of LocalityStack.
58 59 60 |
# File 'lib/relaton_bib/bib_item_locality.rb', line 58 def initialize(locality) @locality = locality end |
Instance Attribute Details
#locality ⇒ Array<RelatonBib::Locality> (readonly)
55 56 57 |
# File 'lib/relaton_bib/bib_item_locality.rb', line 55 def locality @locality end |
Instance Method Details
#to_hash ⇒ Object
70 71 72 |
# File 'lib/relaton_bib/bib_item_locality.rb', line 70 def to_hash { "locality_stack" => single_element_array(locality) } end |
#to_xml(builder) ⇒ Object
63 64 65 66 67 |
# File 'lib/relaton_bib/bib_item_locality.rb', line 63 def to_xml(builder) builder.localityStack do |b| locality.each { |l| l.to_xml(b) } end end |