Module: DaVinciPASTestKit::Generator::Naming
Constant Summary
PASV201::ResourceList::RESOURCE_LIST, PASV201::ResourceList::RESOURCE_SUPPORTED_PROFILES
Class Method Summary
collapse
Class Method Details
.request_type_for_bundle_or_claim ⇒ Object
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
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_profiles ⇒ Object
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(group_metadata)
resource = group_metadata.resource
return resource.underscore unless resource_has_multiple_profiles?(resource)
group_metadata.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(group_metadata)
snake_case_for_profile(group_metadata).camelize
end
|