Class: IsoBibItem::Ics

Inherits:
Isoics::ICS
  • Object
show all
Defined in:
lib/iso_bib_item/iso_bibliographic_item.rb

Overview

Iso ICS classificator.

Instance Method Summary collapse

Constructor Details

#initialize(code = nil, field: nil, group: nil, subgroup: nil) ⇒ Ics

Returns a new instance of Ics.

Parameters:

  • field (Integer) (defaults to: nil)
  • group (Integer) (defaults to: nil)
  • subgroup (Integer) (defaults to: nil)


103
104
105
106
107
108
109
110
# File 'lib/iso_bib_item/iso_bibliographic_item.rb', line 103

def initialize(code = nil, field: nil, group: nil, subgroup: nil)
  unless code || field
    raise ArgumentError, "wrong arguments (should be string or { fieldcode: [String] }"
  end

  field, group, subgroup = code.split '.' if code
  super fieldcode: field, groupcode: group, subgroupcode: subgroup
end

Instance Method Details

#to_xml(builder) ⇒ Object



112
113
114
115
116
117
# File 'lib/iso_bib_item/iso_bibliographic_item.rb', line 112

def to_xml(builder)
  builder.ics do
    builder.code code
    builder.text_ description
  end
end