Skip to content

model: Avoid frozen literal warning#121

Merged
karlnaden merged 1 commit into
inferno-framework:masterfrom
jlduran:avoid-frozen-literal-warning
May 8, 2026
Merged

model: Avoid frozen literal warning#121
karlnaden merged 1 commit into
inferno-framework:masterfrom
jlduran:avoid-frozen-literal-warning

Conversation

@jlduran
Copy link
Copy Markdown
Contributor

@jlduran jlduran commented Apr 16, 2025

Avoid warnings about mutating a literal, as they will be frozen in the future.

@jlduran jlduran force-pushed the avoid-frozen-literal-warning branch from 1119c47 to 644659a Compare April 16, 2025 17:00
@jlduran jlduran force-pushed the avoid-frozen-literal-warning branch from 644659a to eb90cd9 Compare May 5, 2026 16:15
Copy link
Copy Markdown
Contributor

@karlnaden karlnaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread lib/fhir_models/bootstrap/model.rb Outdated
@jlduran jlduran force-pushed the avoid-frozen-literal-warning branch from eb90cd9 to 72c2066 Compare May 6, 2026 20:32
@jlduran jlduran requested a review from karlnaden May 6, 2026 20:33
@karlnaden karlnaden merged commit af138cc into inferno-framework:master May 8, 2026
2 checks passed
@jlduran jlduran deleted the avoid-frozen-literal-warning branch May 8, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants