Sha256: 092e6287f9db1b286cc556e81dc661edb8e651715fee59c65d53b9045c1add72

Contents?: true

Size: 989 Bytes

Versions: 4

Compression:

Stored size: 989 Bytes

Contents

require 'marc'

module BerkeleyLibrary
  module TIND
    module Mapping
      module TindField
        class << self

          def f_035_from_alma_id(alma_id, value_980)
            val = "(#{value_980})#{alma_id}"
            f('035', 'a', val)
          end

          def f_035(val)
            f('035', 'a', val)
          end

          def f_245_p(val)
            f('245', 'p', val)
          end

          def f_fft(url, txt = None)
            return f('FFT', 'a', url) unless txt

            ::MARC::DataField.new('FFT', ' ', ' ', ['d', txt], ['a', url])
          end

          def f_902_d
            f('902', 'd', Time.now.strftime('%F'))
          end

          def f_902_n(name_initial)
            f('902', 'n', name_initial)
          end

          def f_982_p(val)
            f('982', 'p', val)
          end

          def f(tag, code, value)
            ::MARC::DataField.new(tag, ' ', ' ', [code, value])
          end

        end
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
berkeley_library-tind-0.7.2 lib/berkeley_library/tind/mapping/tind_field.rb
berkeley_library-tind-0.7.1 lib/berkeley_library/tind/mapping/tind_field.rb
berkeley_library-tind-0.7.0 lib/berkeley_library/tind/mapping/tind_field.rb
berkeley_library-tind-0.6.0 lib/berkeley_library/tind/mapping/tind_field.rb