Skip to content

Commit

Permalink
replace string interpolation with const_get
Browse files Browse the repository at this point in the history
  • Loading branch information
360dgries committed Oct 17, 2024
1 parent 996181d commit 5521cb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions lib/fhir_client/ext/reference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Reference
include FHIR::ReferenceExtras

def resource_class
"FHIR::#{resource_type}".constantize unless contained?
FHIR.const_get(resource_type).constantize unless contained?
end
end
end
Expand All @@ -93,7 +93,7 @@ class Reference
include FHIR::ReferenceExtras

def resource_class
"FHIR::DSTU2::#{resource_type}".constantize unless contained?
FHIR::DSTU2.const_get(resource_type).constantize unless contained?
end
end
end
Expand All @@ -105,7 +105,7 @@ class Reference
include FHIR::ReferenceExtras

def resource_class
"FHIR::STU3::#{resource_type}".constantize unless contained?
FHIR::STU3.const_get(resource_type).constantize unless contained?
end
end
end
Expand All @@ -117,7 +117,7 @@ class Reference < FHIR::R4B::Model
include FHIR::ReferenceExtras

def resource_class
"FHIR::R4B::#{resource_type}".constantize unless contained?
FHIR::R4B.const_get(resource_type).constantize unless contained?
end
end
end
Expand All @@ -129,7 +129,7 @@ class Reference < FHIR::R5::Model
include FHIR::ReferenceExtras

def resource_class
"FHIR::R5::#{resource_type}".constantize unless contained?
FHIR::R5.const_get(resource_type).constantize unless contained?
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/fhir_client/version_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ def versioned_resource_class(klass = nil)
when :dstu2
FHIR::DSTU2
when :r4b
defined?(FHIR::R4B) ? FHIR::R4B : FHIR
FHIR::R4B
when :r5
defined?(FHIR::R5) ? FHIR::R5 : FHIR
FHIR::R5
else
FHIR
end
Expand Down

0 comments on commit 5521cb2

Please sign in to comment.