Class: HealthcarePhony::Doctor

Inherits:
Object
  • Object
show all
Defined in:
lib/healthcare_phony/doctor.rb

Overview

Public: Generates a fake Doctor

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(init_args = {}) ⇒ Doctor

Public: Initialize a Doctor. Pass in hash of different parameters, currently this includes:

identifier - Allows you to specify an identifier for this Doctor instead of having it randomly generated.



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/healthcare_phony/doctor.rb', line 14

def initialize(init_args = {})
  @identifier = if !init_args[:identifier].nil?
                  init_args[:identifier]
                else
                  pre_check_npi = /1[0-9]{8}/.random_example.to_i
                  (pre_check_npi.to_s + Helper.get_npi_check_digit(pre_check_npi).to_s).to_i
                end

  init_args[:degree] = 'MD,DO'
  @name = PersonName.new(init_args)
end

Instance Attribute Details

#identifierObject

Public: Gets/Sets the String identifier of the doctor.



7
8
9
# File 'lib/healthcare_phony/doctor.rb', line 7

def identifier
  @identifier
end

#nameObject

Public: Gets/Sets the PersonName name of the doctor.



9
10
11
# File 'lib/healthcare_phony/doctor.rb', line 9

def name
  @name
end