model: Avoid frozen literal warning#121
Merged
karlnaden merged 1 commit intoMay 8, 2026
Merged
Conversation
1119c47 to
644659a
Compare
644659a to
eb90cd9
Compare
karlnaden
requested changes
May 6, 2026
Contributor
There was a problem hiding this comment.
github is flaking on me and not allowing me to add additional comments. There are two others beyond the suggestion I made both in the vein of make the code a little cleaner with clearer variable names:
def check_binding_uri(uri_with_version, value)
valid = false
# Strip off the |4.0.0 or |4.0.1 or |2014-03-26 or similar from the ends of URLs
uri = uri_with_version&.gsub(/\|[A-Za-z0-9.-]*/, '')
def self.get(raw_key, hash)
return @@context if ['$context', '$resource'].include?(raw_key)
return @@parent if raw_key == '$parent'
return 'http://unitsofmeasure.org' if raw_key == '%ucum'
return 'http://snomed.info/sct' if raw_key == '%sct'
return 'http://loinc.org' if raw_key == '%loinc'
return raw_key.gsub(/\A\'|\'\Z/, '') if orig_key.start_with?("'") && orig_key.end_with?("'")
key = raw_key.gsub(/\A"|"\Z/, '') # remove quotes around path if they exist
eb90cd9 to
72c2066
Compare
karlnaden
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid warnings about mutating a literal, as they will be frozen in the future.