Closed andrew2net closed 10 months ago
We need to recreate pubid from hash it produces, but the output hash misses document type:
> Pubid::Iso::Identifier.parse("ISO/TR 11071-2:1996").to_h {:publisher=>"ISO", :number=>"11071"@7, :year=>1996, :part=>"2"@13, :edition=>nil}
And attributes with nil values shouldn't be in the output. We need something like this:
nil
> pubid = Pubid::Iso::Identifier.parse("ISO/TR 11071-2:1996") #<Pubid::Iso::Identifier::TechnicalReport:0x00000001011f3c20 @edition=nil, @number="11071"@7, @part="2"@13, @publisher="ISO", @year=1996> > hash = pubid.to_h {:publisher=>"ISO", :type=>"TR", :number=>"11071"@7, :year=>1996, :part=>"2"@13} > Pubid::Iso::Identifier.new(**hash) == pubid true
We need to recreate pubid from hash it produces, but the output hash misses document type:
And attributes with
nil
values shouldn't be in the output. We need something like this: