Class: Renalware::UKRDC::SendPatients
- Inherits:
-
Object
- Object
- Renalware::UKRDC::SendPatients
- Defined in:
- app/models/renalware/ukrdc/send_patients.rb
Instance Attribute Summary collapse
-
#changed_since ⇒ Object
readonly
Returns the value of attribute changed_since.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#patient_ids ⇒ Object
readonly
Returns the value of attribute patient_ids.
-
#request_uuid ⇒ Object
readonly
Returns the value of attribute request_uuid.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(changed_since: nil, patient_ids: nil, logger: nil) ⇒ SendPatients
constructor
A new instance of SendPatients.
Constructor Details
#initialize(changed_since: nil, patient_ids: nil, logger: nil) ⇒ SendPatients
Returns a new instance of SendPatients.
10 11 12 13 14 15 |
# File 'app/models/renalware/ukrdc/send_patients.rb', line 10 def initialize(changed_since: nil, patient_ids: nil, logger: nil) @changed_since = Time.zone.parse(changed_since) if changed_since.present? @patient_ids = Array(patient_ids) @logger = logger || Rails.logger @request_uuid = SecureRandom.uuid # helps group logs together end |
Instance Attribute Details
#changed_since ⇒ Object (readonly)
Returns the value of attribute changed_since.
8 9 10 |
# File 'app/models/renalware/ukrdc/send_patients.rb', line 8 def changed_since @changed_since end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
8 9 10 |
# File 'app/models/renalware/ukrdc/send_patients.rb', line 8 def logger @logger end |
#patient_ids ⇒ Object (readonly)
Returns the value of attribute patient_ids.
8 9 10 |
# File 'app/models/renalware/ukrdc/send_patients.rb', line 8 def patient_ids @patient_ids end |
#request_uuid ⇒ Object (readonly)
Returns the value of attribute request_uuid.
8 9 10 |
# File 'app/models/renalware/ukrdc/send_patients.rb', line 8 def request_uuid @request_uuid end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/models/renalware/ukrdc/send_patients.rb', line 17 def call logger.info "Request #{request_uuid}" ms = Benchmark.ms do send_patients end print_summary(ms) end |