Class: RelatonOgc::OgcBibliographicItem

Inherits:
RelatonIsoBib::IsoBibliographicItem
  • Object
show all
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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ OgcBibliographicItem

Returns a new instance of OgcBibliographicItem.

Parameters:

  • docsubtype (String)


21
22
23
24
25
26
27
28
# File 'lib/relaton_ogc/ogc_bibliographic_item.rb', line 21

def initialize(**args)
  if args[:docsubtype] && !SUBTYPES.include?(args[:docsubtype])
    warn "[relaton-ogc] invalid document subtype: #{args[:docsubtype]}"
  end

  @docsubtype = args.delete :docsubtype
  super
end

Instance Attribute Details

#docsubtypeString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/relaton_ogc/ogc_bibliographic_item.rb', line 18

def docsubtype
  @docsubtype
end

Instance Method Details

#to_hashHash

Returns:

  • (Hash)


31
32
33
34
35
# File 'lib/relaton_ogc/ogc_bibliographic_item.rb', line 31

def to_hash
  hash = super
  hash["docsubtype"] = docsubtype if docsubtype
  hash
end