Class: RelatonOgc::OgcBibliographicItem
- Inherits:
-
RelatonBib::BibliographicItem
- Object
- RelatonBib::BibliographicItem
- RelatonOgc::OgcBibliographicItem
- Defined in:
- lib/relaton_ogc/ogc_bibliographic_item.rb
Constant Summary collapse
- TYPES =
%w[ abstract-specification-topic best-practice change-request-supporting-document community-practice community-standard discussion-paper engineering-report other policy reference-model release-notes standard user-guide white-paper test-suite ].freeze
- SUBTYPES =
%w[ conceptual-model conceptual-model-and-encoding conceptual-model-and-implementation encoding extension implementation profile profile-with-extension general ].freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**args) ⇒ OgcBibliographicItem
constructor
A new instance of OgcBibliographicItem.
-
#to_xml(**opts) ⇒ String
XML.
Constructor Details
#initialize(**args) ⇒ OgcBibliographicItem
Returns a new instance of OgcBibliographicItem.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/relaton_ogc/ogc_bibliographic_item.rb', line 17 def initialize(**args) if args[:subdoctype] && !SUBTYPES.include?(args[:subdoctype]) warn "[relaton-ogc] WARNING: invalid document "\ "subtype: #{args[:subdoctype]}" end # @docsubtype = args.delete :docsubtype # @doctype = args.delete :doctype super end |
Class Method Details
.from_hash(hash) ⇒ RelatonOgc::OgcBibliographicItem
30 31 32 33 |
# File 'lib/relaton_ogc/ogc_bibliographic_item.rb', line 30 def self.from_hash(hash) item_hash = ::RelatonOgc::HashConverter.hash_to_bib(hash) new(**item_hash) end |
Instance Method Details
#to_xml(**opts) ⇒ String
Returns XML.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/relaton_ogc/ogc_bibliographic_item.rb', line 48 def to_xml(**opts) super(**opts) do |b| b.ext do b.doctype doctype if doctype b.subdoctype subdoctype if subdoctype editorialgroup&.to_xml b ics.each { |i| i.to_xml b } end end end |