Class: Gbbib::GbBibliographicItem
- Inherits:
-
IsoBibItem::IsoBibliographicItem
- Object
- IsoBibItem::IsoBibliographicItem
- Gbbib::GbBibliographicItem
- Defined in:
- lib/gbbib/gb_bibliographic_item.rb
Overview
GB bibliographic item class.
Instance Attribute Summary collapse
- #ccs ⇒ Array<Cnccs::Ccs> readonly
- #committee ⇒ Gbbib::GbTechnicalCommittee readonly
- #gbtype ⇒ Gbbib::GbStandardType readonly
- #plan_number ⇒ String readonly
- #topic ⇒ String readonly
- #type ⇒ String readonly
Instance Method Summary collapse
-
#initialize(**args) ⇒ GbBibliographicItem
constructor
A new instance of GbBibliographicItem.
- #to_xml(builder = nil, **opts) ⇒ String
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
#ccs ⇒ Array<Cnccs::Ccs> (readonly)
21 22 23 |
# File 'lib/gbbib/gb_bibliographic_item.rb', line 21 def ccs @ccs end |
#committee ⇒ Gbbib::GbTechnicalCommittee (readonly)
12 13 14 |
# File 'lib/gbbib/gb_bibliographic_item.rb', line 12 def committee @committee end |
#gbtype ⇒ Gbbib::GbStandardType (readonly)
15 16 17 |
# File 'lib/gbbib/gb_bibliographic_item.rb', line 15 def gbtype @gbtype end |
#plan_number ⇒ String (readonly)
24 25 26 |
# File 'lib/gbbib/gb_bibliographic_item.rb', line 24 def plan_number @plan_number end |
#topic ⇒ String (readonly)
18 19 20 |
# File 'lib/gbbib/gb_bibliographic_item.rb', line 18 def topic @topic end |
#type ⇒ String (readonly)
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
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 |