Module: Sfx4::Abstract::AzExtraInfo

Included in:
Local::AzExtraInfo
Defined in:
app/models/sfx4/abstract/az_extra_info.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object


13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/sfx4/abstract/az_extra_info.rb', line 13

def self.included(klass)
  klass.class_eval do
    require 'nokogiri'
    self.table_name = 'AZ_EXTRA_INFO'
    self.primary_key = 'AZ_EXTRA_INFO_ID'

    belongs_to :az_title,
               :foreign_key => 'OBJECT_ID',
               :class_name => "#{klass.to_s.deconstantize}::AzTitle"

    include MetadataHelper # for normalize_lccn
  end
end

Instance Method Details

#extra_info_xmlObject


39
40
41
# File 'app/models/sfx4/abstract/az_extra_info.rb', line 39

def extra_info_xml
  @extra_info_xml ||= Nokogiri::XML(self.EXTRA_INFO_XML)
end

#isbnObject


31
32
33
# File 'app/models/sfx4/abstract/az_extra_info.rb', line 31

def isbn
  @isbn ||= extra_info_xml.search("item[key=isbn]").text
end

#issnObject


27
28
29
# File 'app/models/sfx4/abstract/az_extra_info.rb', line 27

def issn
  @issn ||= extra_info_xml.search("item[key=issn]").text
end

#lccnObject


35
36
37
# File 'app/models/sfx4/abstract/az_extra_info.rb', line 35

def lccn
  @lccn ||= normalize_lccn(extra_info_xml.search("item[key=lccn]").text)
end