metanorma / pubid-core

BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Apply local configuration for entities building #10

Closed mico closed 1 year ago

mico commented 1 year ago

This change is intended to get rid of STAGES_CONFIG global constant and add more flexibility in configuration for pubid-* gems.

After this change, for pubid-iso we do: Identifier.build_harmonized_stage_code("20", "20") Instead of: HarmonizedStageCode.new("20", "20")

Identifier.build_stage(harmonized_code: "50.00", abbr: :PRF) Instead of: Stage.new(harmonized_code: "50.00", abbr: :PRF)

Identifier.build_type(:tr) Instead of: Type.new(:tr)

That's the only change for pubid-iso API we need to do after implementing this changes.

ronaldtse commented 1 year ago

I’m fine with the change, but does it affect @andrew2net and @opoudjis usage of this gem?

mico commented 1 year ago

I’m fine with the change, but does it affect @andrew2net and @opoudjis usage of this gem?

@ronaldtse I believe only pubid-* gems using this gem. It will affect other gems API, as I mentioned above need to update entity creation for pubid-iso.

ronaldtse commented 1 year ago

@mico right, it's not something we can avoid anyway. Let's go with it.