Class: RelatonBib::Locality

Inherits:
BibItemLocality show all
Defined in:
lib/relaton_bib/bib_item_locality.rb

Instance Attribute Summary

Attributes inherited from BibItemLocality

#reference_from, #reference_to, #type

Instance Method Summary collapse

Methods inherited from BibItemLocality

#initialize, #to_bibtex

Constructor Details

This class inherits a constructor from RelatonBib::BibItemLocality

Instance Method Details

#to_asciibib(prefix = "", count = 1) ⇒ String

Render locality as AsciiBib.

Parameters:

  • prefix (String) (defaults to: "")

    prefix of locality

  • count (Integer) (defaults to: 1)

    number of localities

Returns:

  • (String)

    AsciiBib.



95
96
97
98
# File 'lib/relaton_bib/bib_item_locality.rb', line 95

def to_asciibib(prefix = "", count = 1)
  pref = prefix.empty? ? "locality" : "#{prefix}.locality"
  super(pref, count)
end

#to_hashHash

Render locality as hash.

Returns:

  • (Hash)

    locality as hash.



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

def to_hash
  { "locality" => super }
end

#to_xml(builder) ⇒ Object

Parameters:

  • builder (Nokogiri::XML::Builder)


74
75
76
# File 'lib/relaton_bib/bib_item_locality.rb', line 74

def to_xml(builder)
  builder.locality { |b| super(b) }
end