Sha256: 2aee2a3c9aad3fbd7ab59a976bb09b9df91e1f4fb38f47906797589172e02924

Contents?: true

Size: 1.66 KB

Versions: 2

Compression:

Stored size: 1.66 KB

Contents

require 'berkeley_library/marc/field_info/var_fields/var_field_transform'
require 'berkeley_library/marc/field_info/var_fields/data'

module BerkeleyLibrary
  module Marc
    module FieldInfo
      module VarFields

        DATA_DIR = File.expand_path('var_fields/data', __dir__)
        PATH_STANDARD = File.join(DATA_DIR, 'var_fields_standard.txt')

        class << self

          def standard(obsolete: false)
            @standard_all ||= VarFieldTransform.new.apply(BerkeleyLibrary::Marc::FieldInfo::VarFields::STANDARD_PARSED)
            return @standard_all if obsolete

            @standard ||= @standard_all.reject_obsoletes
          end

          def berkeley_9xx(obsolete: false)
            @berkeley_9xx_all ||= VarFieldTransform.new.apply(BerkeleyLibrary::Marc::FieldInfo::VarFields::BERKELEY_9XX_PARSED)
            return @berkeley_9xx_all if obsolete

            @berkeley_9xx ||= @berkeley_9xx_all.reject_obsoletes
          end

          # TODO: get these working
          # def tind_reserved(obsolete: false)
          #   @tind_reserved_all ||= VarFieldTransform.new.apply(BerkeleyLibrary::Marc::FieldInfo::VarFields::TIND_RESERVED_PARSED)
          #   return @tind_reserved_all if obsolete
          #
          #   @tind_reserved ||= @tind_reserved_all.reject_obsoletes
          # end
          #
          # def berkeley_tind(obsolete: false)
          #   @berkeley_tind_all ||= VarFieldTransform.new.apply(BerkeleyLibrary::Marc::FieldInfo::VarFields::BERKELEY_TIND_PARSED)
          #   return @berkeley_tind_all if obsolete
          #
          #   @berkeley_tind ||= @berkeley_tind_all.reject_obsoletes
          # end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
berkeley_library-marc-0.2.1 lib/berkeley_library/marc/field_info/var_fields.rb
berkeley_library-marc-0.2.0 lib/berkeley_library/marc/field_info/var_fields.rb