Module: Inferno::DSL::RequestStorage
- Defined in:
- lib/inferno/dsl/request_storage.rb
Overview
This module handles storing and retrieving requests/responses made by FHIR/HTTP clients
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#load_tagged_requests(*tags) ⇒ Inferno::Entities::Request
Returns requests which match all of the given tags.
-
#request ⇒ Inferno::Entities::Request?
Returns the most recent FHIR/HTTP request.
-
#requests ⇒ Array<Inferno::Entities::Request>
Returns the FHIR/HTTP requests that have been made in this
Test
. -
#resource ⇒ FHIR::Model?
Returns the FHIR resource from the response to the most recent FHIR request.
-
#response ⇒ Hash?
Returns the response from the most recent FHIR/HTTP request.
Instance Method Details
#load_tagged_requests(*tags) ⇒ Inferno::Entities::Request
Returns requests which match all of the given tags
43 44 45 46 47 48 49 |
# File 'lib/inferno/dsl/request_storage.rb', line 43 def load_tagged_requests(*) return [] if .blank? Repositories::Requests.new.tagged_requests(test_session_id, ).tap do |tagged_requests| requests.concat(tagged_requests) end end |
#request ⇒ Inferno::Entities::Request?
Returns the most recent FHIR/HTTP request
20 21 22 |
# File 'lib/inferno/dsl/request_storage.rb', line 20 def request requests.last end |
#requests ⇒ Array<Inferno::Entities::Request>
Returns the FHIR/HTTP requests that have been made in this Test
13 14 15 |
# File 'lib/inferno/dsl/request_storage.rb', line 13 def requests @requests ||= [] end |
#resource ⇒ FHIR::Model?
Returns the FHIR resource from the response to the most recent FHIR request
35 36 37 |
# File 'lib/inferno/dsl/request_storage.rb', line 35 def resource request&.resource end |
#response ⇒ Hash?
Returns the response from the most recent FHIR/HTTP request
27 28 29 |
# File 'lib/inferno/dsl/request_storage.rb', line 27 def response request&.response end |