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.



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

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.



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

def to_hash
  { "locality" => super }
end

#to_xml(builder) ⇒ Object

Parameters:

  • builder (Nokogiri::XML::Builder)


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

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