Sha256: 2d5cdd9dddfc639b4b82e568a03c6b7a78c7645b994c5d3b371c934cfff1f891
Contents?: true
Size: 851 Bytes
Versions: 26
Compression:
Stored size: 851 Bytes
Contents
module RelatonIsoBib # Iso ICS classificator. class Ics < Isoics::ICS # @param code [String, NilClass] # @param field [Integer, NilClass] # @param group [Integer, NilClass] # @param subgroup [Integer, NilClass] 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 # @param builder [Nokogiri::XML::Builder] def to_xml(builder) builder.ics do builder.code code builder.text_ description end end # @return [Hash] def to_hash hash = {} hash["code"] = code if code hash end end end
Version data entries
26 entries across 26 versions & 2 rubygems