Module: DaVinciPASTestKit::Generator::Naming

Extended by:
PASV201::ResourceList
Defined in:
lib/davinci_pas_test_kit/generator/naming.rb

Constant Summary

Constants included from PASV201::ResourceList

PASV201::ResourceList::RESOURCE_LIST, PASV201::ResourceList::RESOURCE_SUPPORTED_PROFILES

Class Method Summary collapse

Class Method Details

.request_type_for_bundle_or_claimObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/davinci_pas_test_kit/generator/naming.rb', line 21

def request_type_for_bundle_or_claim
  {
    'PAS Request Bundle' => 'submit_request',
    'PAS Response Bundle' => 'submit_response',
    'PAS Inquiry Request Bundle' => 'inquire_request',
    'PAS Inquiry Response Bundle' => 'inquire_response',
    'PAS Claim' => 'submit_request',
    'PAS Claim Response' => 'submit_response',
    'PAS Claim Inquiry' => 'inquire_request',
    'PAS Claim Inquiry Response' => 'inquire_response',
    'PAS Claim Update' => 'update_request'
  }
end

.resource_has_multiple_profiles?(resource) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/davinci_pas_test_kit/generator/naming.rb', line 17

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

.resources_with_multiple_profilesObject



9
10
11
12
13
14
15
# File 'lib/davinci_pas_test_kit/generator/naming.rb', line 9

def resources_with_multiple_profiles
  resources = []
  RESOURCE_SUPPORTED_PROFILES.each do |resource, profile_list|
    resources << resource.to_s if profile_list.length > 1
  end
  resources
end

.snake_case_for_profile(group_metadata) ⇒ Object



35
36
37
38
39
40
41
42
# File 'lib/davinci_pas_test_kit/generator/naming.rb', line 35

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

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

.upper_camel_case_for_profile(group_metadata) ⇒ Object



44
45
46
# File 'lib/davinci_pas_test_kit/generator/naming.rb', line 44

def upper_camel_case_for_profile()
  snake_case_for_profile().camelize
end