Class: IsoBibItem::Ics
- Inherits:
-
Isoics::ICS
- Object
- Isoics::ICS
- IsoBibItem::Ics
- Defined in:
- lib/iso_bib_item/iso_bibliographic_item.rb
Overview
Iso ICS classificator.
Instance Method Summary collapse
-
#initialize(code = nil, field: nil, group: nil, subgroup: nil) ⇒ Ics
constructor
A new instance of Ics.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(code = nil, field: nil, group: nil, subgroup: nil) ⇒ Ics
Returns a new instance of Ics.
103 104 105 106 107 108 109 110 |
# File 'lib/iso_bib_item/iso_bibliographic_item.rb', line 103 def initialize(code = nil, field: nil, group: nil, subgroup: nil) unless code || field raise ArgumentError, "wrong arguments (should be string or { fieldcode: [String] }" end field, group, subgroup = code.split '.' if code super fieldcode: field, groupcode: group, subgroupcode: subgroup end |
Instance Method Details
#to_xml(builder) ⇒ Object
112 113 114 115 116 117 |
# File 'lib/iso_bib_item/iso_bibliographic_item.rb', line 112 def to_xml(builder) builder.ics do builder.code code builder.text_ description end end |