Class: Traject::UMichFormat::XV6XX
- Inherits:
-
Object
- Object
- Traject::UMichFormat::XV6XX
- Defined in:
- lib/traject/umich_format/xv6xx.rb
Overview
A utility class to get all the 6XX $v and $x, which are used over and over again in the format finder
Instance Method Summary collapse
-
#initialize(record) ⇒ XV6XX
constructor
Find all the 6XXxv values in the given record.
-
#match?(regex) ⇒ Boolean
Do any of the 6XXxv values match the given regex?.
Constructor Details
#initialize(record) ⇒ XV6XX
Find all the 6XXxv values in the given record
7 8 9 10 11 12 13 14 |
# File 'lib/traject/umich_format/xv6xx.rb', line 7 def initialize(record) @vals = [] record.fields('600'..'699').each do |f| f.each do |sf| @vals << sf.value if %[x v].include?(sf.code) end end end |
Instance Method Details
#match?(regex) ⇒ Boolean
Do any of the 6XXxv values match the given regex?
20 21 22 |
# File 'lib/traject/umich_format/xv6xx.rb', line 20 def match?(regex) return @vals.grep(regex).size > 0 end |