Sha256: 8db44db08fc0aaa8cc0d65de163ebe333216b179516da8a858c1c58687118cd1

Contents?: true

Size: 884 Bytes

Versions: 3

Compression:

Stored size: 884 Bytes

Contents

# frozen_string_literal:true

module RelatonCie
  # IETF bibliography module
  module CieBibliography
    class << self
      # @param code [String] the ECMA standard Code to look up (e..g "ECMA-6")
      # @return [RelatonBib::BibliographicEcma]
      def search(code)
        Scrapper.scrape_page code
      end

      # @param code [String] the ECMA standard Code to look up (e..g "ECMA-6")
      # @param year [String] not used
      # @param opts [Hash] not used
      # @return [RelatonCie::BibliographicItem] Relaton of reference
      def get(code, _year = nil, _opts = {})
        Util.info "Fetching from Relaton repository ...", key: code
        result = search code
        if result
          Util.info "Found: `#{result.docidentifier.first.id}`", key: code
        else
          Util.info "Not found.", key: code
        end
        result
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
relaton-cie-1.20.0 lib/relaton_cie/cie_bibliography.rb
relaton-cie-1.19.1 lib/relaton_cie/cie_bibliography.rb
relaton-cie-1.19.0 lib/relaton_cie/cie_bibliography.rb