Sha256: 0634b9eb43c679166587dc849889f1316998e439eaf437ba519769a5fcd19073

Contents?: true

Size: 1.4 KB

Versions: 16

Compression:

Stored size: 1.4 KB

Contents

require "relaton/processor"

module RelatonW3c
  class Processor < Relaton::Processor
    attr_reader :idtype

    def initialize # rubocop:disable Lint/MissingSuper
      @short = :relaton_w3c
      @prefix = "W3C"
      @defaultprefix = %r{^W3C\s}
      @idtype = "W3C"
      @datasets = %w[w3c-rdf]
    end

    # @param code [String]
    # @param date [String, NilClass] year
    # @param opts [Hash]
    # @return [RelatonW3C::W3cBibliographicItem]
    def get(code, date, opts)
      ::RelatonW3c::W3cBibliography.get(code, date, opts)
    end

    #
    # Fetch all the documents from http://www.w3.org/2002/01/tr-automation/tr.rdf
    #
    # @param [String] _source source name
    # @param [Hash] opts
    # @option opts [String] :output directory to output documents
    # @option opts [String] :format
    #
    def fetch_data(_source, opts)
      DataFetcher.fetch(**opts)
    end

    # @param xml [String]
    # @return [RelatonCalconnect::CcBibliographicItem]
    def from_xml(xml)
      ::RelatonW3c::XMLParser.from_xml xml
    end

    # @param hash [Hash]
    # @return [RelatonIsoBib::CcBibliographicItem]
    def hash_to_bib(hash)
      item_hash = ::RelatonW3c::HashConverter.hash_to_bib(hash)
      ::RelatonW3c::W3cBibliographicItem.new(**item_hash)
    end

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
relaton-w3c-1.12.0 lib/relaton_w3c/processor.rb
relaton-w3c-1.11.6 lib/relaton_w3c/processor.rb
relaton-w3c-1.11.5 lib/relaton_w3c/processor.rb
relaton-w3c-1.11.4 lib/relaton_w3c/processor.rb
relaton-w3c-1.11.3 lib/relaton_w3c/processor.rb
relaton-w3c-1.11.2 lib/relaton_w3c/processor.rb
relaton-w3c-1.11.1 lib/relaton_w3c/processor.rb
relaton-w3c-1.11.0 lib/relaton_w3c/processor.rb
relaton-w3c-1.10.1 lib/relaton_w3c/processor.rb
relaton-w3c-1.10.0 lib/relaton_w3c/processor.rb
relaton-w3c-1.9.6 lib/relaton_w3c/processor.rb
relaton-w3c-1.9.5 lib/relaton_w3c/processor.rb
relaton-w3c-1.9.4 lib/relaton_w3c/processor.rb
relaton-w3c-1.9.3 lib/relaton_w3c/processor.rb
relaton-w3c-1.9.2 lib/relaton_w3c/processor.rb
relaton-w3c-1.9.1 lib/relaton_w3c/processor.rb