Module: Drillbit::Resource::Naming::ClassMethods

Defined in:
lib/drillbit/resource/naming.rb

Instance Method Summary collapse

Instance Method Details

#plural_resource_nameObject



10
11
12
13
14
15
# File 'lib/drillbit/resource/naming.rb', line 10

def plural_resource_name
  @plural_resource_name ||= name[CONTROLLER_RESOURCE_NAME_PATTERN, 3]
                              .underscore
                              .pluralize
                              .downcase
end

#resource_class_nameObject



24
25
26
27
# File 'lib/drillbit/resource/naming.rb', line 24

def resource_class_name
  @resource_class_name ||= singular_resource_name
                             .camelize
end

#singular_resource_nameObject



17
18
19
20
21
22
# File 'lib/drillbit/resource/naming.rb', line 17

def singular_resource_name
  @singular_resource_name ||= name[CONTROLLER_RESOURCE_NAME_PATTERN, 3]
                                .underscore
                                .singularize
                                .downcase
end