class IsoBibItem::Address

Address class.

Attributes

city[R]

@return [String]

country[R]

@return [String]

postcode[R]

@return [String, NilClass]

state[R]

@return [String, NilClass]

street[R]

@return [Array<String>]

Public Class Methods

new(street:, city:, state: nil, country:, postcode: nil) click to toggle source

@param street [Array<String>] @param city [String] @param state [String] @param country [String] @param postcode [String]

# File lib/iso_bib_item/contributor.rb, line 28
def initialize(street:, city:, state: nil, country:, postcode: nil)
  @street   = street
  @city     = city
  @state    = state
  @country  = country
  @postcode = postcode
end

Public Instance Methods

to_xml(doc) click to toggle source

@param builder [Nokogiri::XML::Document]

# File lib/iso_bib_item/contributor.rb, line 37
def to_xml(doc)
  doc.address do
    street.each { |str| doc.street str }
    doc.city city
    doc.state state if state
    doc.country country
    doc.postcode postcode if postcode
  end
end