Class: PrescriptionPreference

Inherits:
Common::Base show all
Includes:
ActiveModel::Validations
Defined in:
app/models/prescription_preference.rb

Overview

@return [Boolean]

Instance Attribute Summary

Attributes inherited from Common::Base

#errors_hash, #metadata

Instance Method Summary collapse

Methods inherited from Common::Base

#changed, #changed?, #changes, default_sort, filterable_attributes, #initialize, max_per_page, per_page, sortable_attributes

Constructor Details

This class inherits a constructor from Common::Base

Instance Method Details

#idString

Compute a hex-formatted digest of the attributes to be used as an ID

Returns:

  • (String)


44
45
46
# File 'app/models/prescription_preference.rb', line 44

def id
  Digest::SHA256.hexdigest(instance_variable_get(:@original_attributes).to_json)
end

#mhv_paramsHash

Build the object for MHV

Returns:

  • (Hash)

Raises:



33
34
35
36
37
# File 'app/models/prescription_preference.rb', line 33

def mhv_params
  raise Common::Exceptions::ValidationErrors, self unless valid?

  { email_address:, rx_flag: }
end