Class: RelatonItu::ItuBibliographicItem
- Inherits:
-
RelatonIsoBib::IsoBibliographicItem
- Object
- RelatonIsoBib::IsoBibliographicItem
- RelatonItu::ItuBibliographicItem
- Defined in:
- lib/relaton_itu/itu_bibliographic_item.rb
Constant Summary collapse
- TYPES =
%w[ recommendation recommendation-supplement recommendation-amendment recommendation-corrigendum recommendation-errata recommendation-annex focus-group implementers-guide technical-paper technical-report joint-itu-iso-iec ].freeze
Instance Method Summary collapse
-
#initialize(**args) ⇒ ItuBibliographicItem
constructor
A new instance of ItuBibliographicItem.
- #to_xml(builder = nil, **opts) ⇒ Object
Constructor Details
#initialize(**args) ⇒ ItuBibliographicItem
Returns a new instance of ItuBibliographicItem.
10 11 12 13 14 15 16 17 |
# File 'lib/relaton_itu/itu_bibliographic_item.rb', line 10 def initialize(**args) @doctype = args.delete :type if doctype && !TYPES.include?(doctype) raise ArgumentError, "invalid type: #{doctype}" end super end |
Instance Method Details
#to_xml(builder = nil, **opts) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/relaton_itu/itu_bibliographic_item.rb', line 19 def to_xml(builder = nil, **opts) super builder, **opts do |b| if opts[:bibdata] # b.doctype doctype if doctype end end end |