Sha256: b9474b57c053aa7c8c3f09a8358505cda4d3dd8173ca4261da51bca7b73c700b
Contents?: true
Size: 1.01 KB
Versions: 9
Compression:
Stored size: 1.01 KB
Contents
module Faalis module Generators module Concerns # Adds the `name` key to json file which specify the resource name. module ResourceName private # Path to the resource def resource_path path_parts = resource_data["name"].split("/") if path_parts.length > 1 return "#{path_parts(0..-2).join("/")}/#{path_parts[-1].underscore}" end resource_data["name"].underscore end # Url of resource def resource_url path_parts = resource_data["name"].split("/") if path_parts.length > 1 return "#{path_parts(0..-2).join("/")}/#{path_parts[-1].pluralize.underscore}" end resource_data["name"].pluralize.underscore end def resource path_parts = resource_data["name"].split("/") if path_parts.length > 1 return path_parts[-1].camelize end resource_data["name"].camelize end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems