Sha256: 246b07a8b8034a3ffe137e8ed74710714a5894fb37e9b0670d04d038512005e6
Contents?: true
Size: 1.08 KB
Versions: 2
Compression:
Stored size: 1.08 KB
Contents
require 'berkeley_library/marc/field_info/var_fields/var_field_def' require 'berkeley_library/marc/field_info/var_fields/obsolescible' module BerkeleyLibrary module Marc module FieldInfo module VarFields class Section include Enumerable include Obsolescible attr_reader :desc attr_reader :var_fields def initialize(desc:, var_fields:) @desc = desc @var_fields = var_fields end def each(&block) return to_enum(:each) unless block_given? var_fields.each(&block) end def size var_fields.size end def empty? var_fields.empty? end def reject_obsoletes Section.new( desc: desc, var_fields: _reject_obsolete(var_fields) ) end def to_s blocks = ["--#{desc}--"] blocks.concat(var_fields.map(&:to_s)) blocks.join("\n") 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/section.rb |
berkeley_library-marc-0.2.0 | lib/berkeley_library/marc/field_info/var_fields/section.rb |