Class: Luma::Models::PatientResponse
- Inherits:
-
Object
- Object
- Luma::Models::PatientResponse
- Defined in:
- lib/luma/models/patient_response.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #contact ⇒ Object
- #do_not_contact ⇒ Object
- #errors? ⇒ Boolean
-
#initialize(data: nil, response: nil) ⇒ PatientResponse
constructor
A new instance of PatientResponse.
- #ok? ⇒ Boolean
Constructor Details
#initialize(data: nil, response: nil) ⇒ PatientResponse
Returns a new instance of PatientResponse.
6 7 8 9 10 11 |
# File 'lib/luma/models/patient_response.rb', line 6 def initialize(data: nil, response: nil) @data = data @data = response.parsed_response if @data.nil? && response && response.ok? @data ||= {} @response = response end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/luma/models/patient_response.rb', line 4 def data @data end |
Instance Method Details
#contact ⇒ Object
17 18 19 |
# File 'lib/luma/models/patient_response.rb', line 17 def contact @data['contact'] end |
#do_not_contact ⇒ Object
13 14 15 |
# File 'lib/luma/models/patient_response.rb', line 13 def do_not_contact @data['doNotContact'] end |
#errors? ⇒ Boolean
25 26 27 |
# File 'lib/luma/models/patient_response.rb', line 25 def errors? !@data['errors'].nil? && !@data['errors'].empty? end |
#ok? ⇒ Boolean
21 22 23 |
# File 'lib/luma/models/patient_response.rb', line 21 def ok? @response&.ok? end |