Module: DaVinciUSDrugFormularyTestKit::Generator::Naming

Defined in:
lib/davinci_us_drug_formulary_test_kit/generator/naming.rb

Class Method Summary collapse

Class Method Details

.resource_has_multiple_profiles?(resource) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/davinci_us_drug_formulary_test_kit/generator/naming.rb', line 9

def resource_has_multiple_profiles?(resource)
  resources_with_multiple_profiles.include? resource
end

.resources_with_multiple_profilesObject



5
6
7
# File 'lib/davinci_us_drug_formulary_test_kit/generator/naming.rb', line 5

def resources_with_multiple_profiles
  ['InsurancePlan']
end

.snake_case_for_profile(group_metadata) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/davinci_us_drug_formulary_test_kit/generator/naming.rb', line 13

def snake_case_for_profile()
  resource = .resource
  return resource.underscore unless resource_has_multiple_profiles?(resource)

  .name
    .delete_prefix('usdf_')
    .underscore
end

.upper_camel_case_for_profile(group_metadata) ⇒ Object



22
23
24
# File 'lib/davinci_us_drug_formulary_test_kit/generator/naming.rb', line 22

def upper_camel_case_for_profile()
  snake_case_for_profile().camelize
end