Sha256: b61f7ac350639ff59011bbc95346db7fe72e76c97175026203b4e67a99f5d9b8

Contents?: true

Size: 1.52 KB

Versions: 27

Compression:

Stored size: 1.52 KB

Contents

# +------------------+---------------------+------+-----+---------+----------------+
# | Field            | Type                | Null | Key | Default | Extra          |
# +------------------+---------------------+------+-----+---------+----------------+
# | AZ_EXTRA_INFO_ID | int(10) unsigned    | NO   | PRI | NULL    | auto_increment |
# | AZ_PROFILE       | varchar(100)        | NO   |     | NULL    |                |
# | OBJECT_ID        | bigint(20) unsigned | NO   | MUL | 0       |                |
# | EXTRA_INFO_XML   | mediumtext          | YES  |     | NULL    |                |
# +------------------+---------------------+------+-----+---------+----------------+
module Sfx4
  module Abstract
    module AzExtraInfo
    
      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

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

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

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

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

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
umlaut-4.1.7 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.1.6 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.1.5 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.1.4 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.1.3 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.1.2 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.1.1 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.1.0 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.1.0.pre3 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.1.0.pre.2 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.1.0.pre.alpha.1 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.0.3 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.0.2 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.0.1 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.0.0 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.0.0.beta5 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.0.0.beta4 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.0.0.beta3 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.0.0.beta2 app/models/sfx4/abstract/az_extra_info.rb
umlaut-4.0.0.beta1 app/models/sfx4/abstract/az_extra_info.rb