class IsoBibItem::Series

Series class.

Attributes

abbreviation[R]

@return [IsoBibItem::LocalizedString]

from[R]

@return [String] date or year

number[R]

@return [String]

organization[R]

@return [String]

part_number[R]

@return [String]

place[R]

@return [String]

title[R]

@return [IsoBibItem::FormattedString] title

to[R]

@return [String] date or year

type[R]

@return [String] allowed values: “main” or “alt”

Public Class Methods

new(**args) click to toggle source

@param [Hash] **args <description>

# File lib/iso_bib_item/series.rb, line 38
def initialize(**args)
  unless args[:title].is_a? IsoBibItem::FormattedString
    raise ArgumentError, 'Parametr `title` shoud present'
  end
  @type         = args[:type] if %w[main alt].include? args[:type]
  @title        = args[:title]
  @place        = args[:place]
  @organization = args[:organization]
  @abbreviation = args[:abbreviation]
  @from         = args[:from]
  @to           = args[:to]
  @number       = args[:number]
  @part_number  = args[:part_number]
end

Public Instance Methods

to_xml(builder) click to toggle source

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

# File lib/iso_bib_item/series.rb, line 57
def to_xml(builder)
  builder.series type: type do
    builder.title { title.to_xml builder } if title
    builder.place place if place
    builder.organization organization if organization
    builder.abbreviation { abbreviation.to_xml builder } if abbreviation
    builder.from from if from
    builder.to to if to
    builder.number number if number
    builder.part_number part_number if part_number
  end
end