Sha256: e5a3dad4265be70fae2e2f45fc3d13533ac48cebcf07b60a79546773c23e04ef
Contents?: true
Size: 547 Bytes
Versions: 12
Compression:
Stored size: 547 Bytes
Contents
module Lanes::Concerns # @see ClassMethods module ApiPath extend ActiveSupport::Concern module ClassMethods def api_path(with_module: false) path = with_module ? to_s : to_s.demodulize path.pluralize.underscore.dasherize end def from_api_path(path) name = path.underscore.camelize.singularize name = "Lanes::#{name}" unless name=~/^Lanes/ name.safe_constantize end end end end
Version data entries
12 entries across 12 versions & 1 rubygems