Sha256: ae2a9d204f2fe06f239acf10c6981693123d2b55fc5965a04ff843b6fa959428

Contents?: true

Size: 1.04 KB

Versions: 14

Compression:

Stored size: 1.04 KB

Contents

require "relaton/processor"

module RelatonIec
  class Processor < Relaton::Processor
    def initialize
      @short = :relaton_iec
      @prefix = "IEC"
      @defaultprefix = %r{^IEC\s|^IEV($|\s)}
      @idtype = "IEC"
    end

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonIsoBib::IecBibliographicItem]
    def get(code, date, opts)
      ::RelatonIec::IecBibliography.get(code, date, opts)
    end

    # @param xml [String]
    # @return [RelatonIsoBib::IecBibliographicItem]
    def from_xml(xml)
      RelatonIec::XMLParser.from_xml xml
    end

    # @param hash [Hash]
    # @return [RelatonIsoBib::IecBibliographicItem]
    def hash_to_bib(hash)
      ::RelatonIec::IecBibliographicItem.from_hash hash
    end

    # Returns hash of XML grammar
    # @return [String]
    def grammar_hash
      @grammar_hash ||= ::RelatonIec.grammar_hash
    end

    # @param code [String]
    # @return [String, nil]
    def urn_to_code(code)
      RelatonIec.urn_to_code code
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
relaton-iec-1.14.1 lib/relaton_iec/processor.rb
relaton-iec-1.14.0 lib/relaton_iec/processor.rb
relaton-iec-1.13.0 lib/relaton_iec/processor.rb
relaton-iec-1.12.0 lib/relaton_iec/processor.rb
relaton-iec-1.11.4 lib/relaton_iec/processor.rb
relaton-iec-1.11.3 lib/relaton_iec/processor.rb
relaton-iec-1.11.2 lib/relaton_iec/processor.rb
relaton-iec-1.11.1 lib/relaton_iec/processor.rb
relaton-iec-1.11.0 lib/relaton_iec/processor.rb
relaton-iec-1.10.1 lib/relaton_iec/processor.rb
relaton-iec-1.10.0 lib/relaton_iec/processor.rb
relaton-iec-1.9.0 lib/relaton_iec/processor.rb
relaton-iec-1.8.0 lib/relaton_iec/processor.rb
relaton-iec-1.7.8 lib/relaton_iec/processor.rb