metanorma / pubid-iso

Implementation of ISO pubid
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Setting a default format for to_s #98

Closed ronaldtse closed 1 year ago

ronaldtse commented 2 years ago

As done in #77, there are 6 pre-defined string formats for an ISO PubID:

> pubid.to_s(:ref_num_short)
=> "ISO 8601-1:2019/DAM 1:2021(E)"
> pubid.to_s(:ref_num_long)
=> "ISO 8601-1:2019/DAmd 1:2021(en)"
> pubid.to_s(:ref_dated)
=> "ISO 8601-1:2019/DAM 1:2021"
> pubid.to_s(:ref_dated_long)
=> "ISO 8601-1:2019/DAmd 1:2021"
> pubid.to_s(:ref_undated)
=> "ISO 8601-1:2019/DAM 1"
> pubid.to_s(:ref_undated_long)
=> "ISO 8601-1:2019/DAmd 1"

Now we need to set a default format.

ronaldtse commented 2 years ago

Argument for ref_num_long

Short: "ISO 8601-1:2019/DAM 1" can't be found on iso.org image

Long: "ISO 8601-1:2019/DAmd 1" can be found on iso.org image

ronaldtse commented 2 years ago

Let's use ref_dated_long as the default of to_s for now. Thanks!

opoudjis commented 1 year ago

@ronaldtse

Once again, I am being left out of the loop, and that is wreaking havoc on my testing.

Until now, I was generating the iso-reference identifier as

ISO 8601-1:2019/DAmd 1:2021(E)

I have no idea what I am meant to put in there now, so I'm just going to guess that it's going to be

"ISO 8601-1:2019/DAmd 1:2021(en)"