Class: RelatonIso::Hit

Inherits:
RelatonBib::Hit
  • Object
show all
Defined in:
lib/relaton_iso/hit.rb

Overview

Hit.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fetch(lang = nil) ⇒ RelatonIso::IsoBibliographicItem

Parse page.

Parameters:

  • lang (String, NilClass) (defaults to: nil)

Returns:

  • (RelatonIso::IsoBibliographicItem)


12
13
14
# File 'lib/relaton_iso/hit.rb', line 12

def fetch(lang = nil)
  @fetch ||= Scrapper.parse_page @hit, lang
end

Instance Method Details

#sort_weightInteger

Returns:

  • (Integer)


17
18
19
20
21
22
23
24
25
# File 'lib/relaton_iso/hit.rb', line 17

def sort_weight
  case hit[:status] # && hit["publicationStatus"]["key"]
  when "Published" then 0
  when "Under development" then 1
  when "Withdrawn" then 2
  when "Deleted" then 3
  else 4
  end
end