Sha256: 22632f7808e375b4118553f200b0ab73d619a895e04373625512c32c38ae2f36

Contents?: true

Size: 1.02 KB

Versions: 33

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal:true

require "relaton_ietf/scrapper"

module RelatonIetf
  # IETF bibliography module
  module IetfBibliography
    class << self
      # @param code [String] the ISO standard Code to look up (e..g "ISO 9000")
      # @return [RelatonIetf::IetfBibliographicItem]
      def search(text)
        Scrapper.scrape_page text
      end

      # @param code [String] the ISO standard Code to look up (e..g "ISO 9000")
      # @param year [String] the year the standard was published (optional)
      # @param opts [Hash] options; restricted to :all_parts if all-parts
      #   reference is required
      # @return [RelatonIetf::IetfBibliographicItem] Relaton of reference
      def get(code, _year = nil, _opts = {})
        warn "[relaton-ietf] (\"#{code}\") fetching..."
        result = search code
        if result
          warn "[relaton-ietf] (\"#{code}\") found #{result.docidentifier.first.id}"
        else
          warn "[relaton-ietf] (\"#{code}\") not found"
        end
        result
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
relaton-ietf-1.12.2 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.12.1 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.12.0 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.11.6 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.11.5 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.11.4 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.11.3 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.11.2 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.11.1 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.11.0 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.10.6 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.10.5 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.10.4 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.10.3 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.10.2 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.10.1 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.10.0 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.9.13 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.9.12 lib/relaton_ietf/ietf_bibliography.rb
relaton-ietf-1.9.11 lib/relaton_ietf/ietf_bibliography.rb