Class: IsoBibItem::Series
- Inherits:
-
Object
- Object
- IsoBibItem::Series
- Defined in:
- lib/iso_bib_item/series.rb
Overview
Series class.
Instance Attribute Summary collapse
- #abbreviation ⇒ IsoBibItem::LocalizedString readonly
-
#from ⇒ String
readonly
Date or year.
- #number ⇒ String readonly
- #organization ⇒ String readonly
- #part_number ⇒ String readonly
- #place ⇒ String readonly
-
#title ⇒ IsoBibItem::FormattedString
readonly
Title.
-
#to ⇒ String
readonly
Date or year.
-
#type ⇒ String
readonly
Allowed values: “main” or “alt”.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Series
constructor
A new instance of Series.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(**args) ⇒ Series
Returns a new instance of Series.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# 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 |
Instance Attribute Details
#abbreviation ⇒ IsoBibItem::LocalizedString (readonly)
21 22 23 |
# File 'lib/iso_bib_item/series.rb', line 21 def abbreviation @abbreviation end |
#from ⇒ String (readonly)
Returns date or year.
24 25 26 |
# File 'lib/iso_bib_item/series.rb', line 24 def from @from end |
#number ⇒ String (readonly)
30 31 32 |
# File 'lib/iso_bib_item/series.rb', line 30 def number @number end |
#organization ⇒ String (readonly)
18 19 20 |
# File 'lib/iso_bib_item/series.rb', line 18 def organization @organization end |
#part_number ⇒ String (readonly)
33 34 35 |
# File 'lib/iso_bib_item/series.rb', line 33 def part_number @part_number end |
#place ⇒ String (readonly)
15 16 17 |
# File 'lib/iso_bib_item/series.rb', line 15 def place @place end |
#title ⇒ IsoBibItem::FormattedString (readonly)
Returns title.
12 13 14 |
# File 'lib/iso_bib_item/series.rb', line 12 def title @title end |
#to ⇒ String (readonly)
Returns date or year.
27 28 29 |
# File 'lib/iso_bib_item/series.rb', line 27 def to @to end |
#type ⇒ String (readonly)
Returns allowed values: “main” or “alt”.
9 10 11 |
# File 'lib/iso_bib_item/series.rb', line 9 def type @type end |
Instance Method Details
#to_xml(builder) ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 |
# 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 |