Sha256: d2cc229cb963f28f347b756a5aa1658c3bd6ab709fbe8fac437a2f46f1ac7845

Contents?: true

Size: 992 Bytes

Versions: 3

Compression:

Stored size: 992 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 = {})
        warn "[relaton-cie] (\"#{code}\") fetching..."
        result = search code
        if result
          warn "[relaton-cie] (\"#{code}\") found #{result.docidentifier.first.id}"
        else
          warn "[relaton-cie] WARNING no match found online for #{code}. " \
               "The code must be exactly like it is on the standards website."
        end
        result
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
relaton-cie-1.16.0 lib/relaton_cie/cie_bibliography.rb
relaton-cie-1.14.1 lib/relaton_cie/cie_bibliography.rb
relaton-cie-1.14.0 lib/relaton_cie/cie_bibliography.rb