apple_core 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13237b1da44ad1e6c7756dad40cc538856daeece333b4f8515bafe23a4b895a0
4
- data.tar.gz: bbc91682ccba61280d2d30cc0c70ff4f07e7b08a64e6e99534b97c71ad55bc8a
3
+ metadata.gz: 8f78954a2f3780ab80a53db0893ef7b7c20047c28d3144d8b12bba76233bde14
4
+ data.tar.gz: 62ed470b4b4f54de9319edb1fc16601c144252a215124e19388904d5a3931ab0
5
5
  SHA512:
6
- metadata.gz: 770eac76a20b07d208284a092d0232d2373f6e0607f8995c3efb6e2298cdbbc3a7a1671d974559c73afb47d0a33833b3f0f3b0f74ec507dc5f69cdf7ae43eec9
7
- data.tar.gz: 34c1b517dee543e4d322f9fde2dabcda746ecc40ddff2d26649d7e6ef6469ed08a0a15fae1c442aafc513787e7c27987339e5071bd5f60ac26c8d9f573abf6fb
6
+ metadata.gz: b8b0db52a2b40174eeb7b6a8a00f7b01b3952a2da6b4a419f19202afa0f11ea961ec810b8dca2b26f4702211c7c25cf229e517a0ac60a3ded1e1d3bbc736986c
7
+ data.tar.gz: 8f3a7c790197e7f05acef286df00cae70299e48f064d9c21142c889a793989ed346cf990d5891dc3251d47ed38821f31b24c8b16cd55cc2d1d9fc5877fd8f816
checksums.yaml.gz.sig CHANGED
Binary file
@@ -44,18 +44,18 @@ module ResourceNaming
44
44
  base.extend(self)
45
45
  end
46
46
 
47
- def plural_underscored_base_resource_name
48
- @plural_underscored_base_resource_name ||= plural_resource_base_class_name
49
- .underscore
50
- .downcase
51
- end
52
-
53
47
  def singular_underscored_base_resource_name
54
48
  @singular_underscored_base_resource_name ||= singular_resource_base_class_name
55
49
  .underscore
56
50
  .downcase
57
51
  end
58
52
 
53
+ def plural_underscored_base_resource_name
54
+ @plural_underscored_base_resource_name ||= plural_resource_base_class_name
55
+ .underscore
56
+ .downcase
57
+ end
58
+
59
59
  def singular_resource_base_class_name
60
60
  @singular_resource_base_class_name ||= plural_resource_base_class_name
61
61
  .singularize
@@ -66,12 +66,27 @@ module ResourceNaming
66
66
  .pluralize
67
67
  end
68
68
 
69
+ def singular_resource_class_name
70
+ @singular_resource_class_name ||= [
71
+ name_components['root_module'],
72
+ resource_name,
73
+ ]
74
+ .compact
75
+ .join('::')
76
+ end
77
+
78
+ def plural_resource_class_name
79
+ @plural_resource_class_name ||= singular_resource_class_name
80
+ .pluralize
81
+ end
82
+
69
83
  def name_components
70
- name.match(CONTROLLER_RESOURCE_NAME_PATTERN).named_captures
84
+ @name_components ||= name.match(CONTROLLER_RESOURCE_NAME_PATTERN).named_captures
71
85
  end
72
86
 
73
87
  def resource_name
74
- name[CONTROLLER_RESOURCE_NAME_PATTERN, 'resource_name']
88
+ @resource_name ||= name_components['resource_name']
89
+ .singularize
75
90
  end
76
91
  end
77
92
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppleCore
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.0'
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apple_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thegranddesign
metadata.gz.sig CHANGED
Binary file