Class: Gbbib::GbBibliographicItem

Inherits:
IsoBibItem::IsoBibliographicItem
  • Object
show all
Defined in:
lib/gbbib/gb_bibliographic_item.rb

Overview

GB bibliographic item class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GbBibliographicItem

Returns a new instance of GbBibliographicItem.



29
30
31
32
33
34
35
# File 'lib/gbbib/gb_bibliographic_item.rb', line 29

def initialize(**args)
  super
  @committee = GbTechnicalCommittee.new args[:committee]
  @ccs = args[:ccs].map { |c| Cnccs.fetch c }
  @gbtype = GbStandardType.new args[:gbtype]
  @type = args[:type]
end

Instance Attribute Details

#ccsArray<Cnccs::Ccs> (readonly)

Returns:

  • (Array<Cnccs::Ccs>)


21
22
23
# File 'lib/gbbib/gb_bibliographic_item.rb', line 21

def ccs
  @ccs
end

#committeeGbbib::GbTechnicalCommittee (readonly)



12
13
14
# File 'lib/gbbib/gb_bibliographic_item.rb', line 12

def committee
  @committee
end

#gbtypeGbbib::GbStandardType (readonly)



15
16
17
# File 'lib/gbbib/gb_bibliographic_item.rb', line 15

def gbtype
  @gbtype
end

#plan_numberString (readonly)

Returns:

  • (String)


24
25
26
# File 'lib/gbbib/gb_bibliographic_item.rb', line 24

def plan_number
  @plan_number
end

#topicString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/gbbib/gb_bibliographic_item.rb', line 18

def topic
  @topic
end

#typeString (readonly)

Returns:

  • (String)


27
28
29
# File 'lib/gbbib/gb_bibliographic_item.rb', line 27

def type
  @type
end

Instance Method Details

#to_xml(builder = nil, **opts) ⇒ String

Parameters:

  • builder (Nokogiri::XML::Builder) (defaults to: nil)

Returns:

  • (String)


39
40
41
42
43
44
45
46
47
# File 'lib/gbbib/gb_bibliographic_item.rb', line 39

def to_xml(builder = nil, **opts)
  if builder
    super(builder, opts) { |xml| render_gbxml(xml) }
  else
    Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |bldr|
      super(bldr, opts) { |xml| render_gbxml(xml) }
    end.doc.root.to_xml
  end
end