Sha256: f828916ec5ddfe39173d6c417dee1d88606cbe9928e7278f96a979ff836cd216

Contents?: true

Size: 849 Bytes

Versions: 3

Compression:

Stored size: 849 Bytes

Contents

# frozen_string_literal:true

module RelatonOmg
  # OMG bibliography module
  module OmgBibliography
    class << self
      # @param code [String] the OMG standard reference
      # @return [RelatonOmg::OmgBibliographicItem]
      def search(text)
        Scrapper.scrape_page text
      end

      # @param code [String] the OMG standard reference
      # @param year [String] the year the standard was published (optional)
      # @param opts [Hash] options
      # @return [RelatonOmg::OmgBibliographicItem]
      def get(code, _year = nil, _opts = {})
        Util.warn "(#{code}) Fetching from www.omg.org ..."
        result = search code
        if result
          Util.warn "(#{code}) Found: `#{result.docidentifier.first.id}`"
        else
          Util.warn "(#{code}) Not found."
        end
        result
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
relaton-omg-1.18.0 lib/relaton_omg/omg_bibliography.rb
relaton-omg-1.17.0 lib/relaton_omg/omg_bibliography.rb
relaton-omg-1.16.2 lib/relaton_omg/omg_bibliography.rb