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.
70 71 72 |
# File 'lib/relaton_bib/bib_item_locality.rb', line 70 def initialize(locality) @locality = locality end |
Instance Attribute Details
#locality ⇒ Array<RelatonBib::Locality> (readonly)
67 68 69 |
# File 'lib/relaton_bib/bib_item_locality.rb', line 67 def locality @locality end |
Instance Method Details
#to_hash ⇒ Object
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
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 |