Module: Hippo::Concerns::ApiPath::ClassMethods
- Defined in:
- lib/hippo/concerns/api_path.rb
Instance Method Summary collapse
Instance Method Details
#api_path(with_module: false) ⇒ Object
9 10 11 12 |
# File 'lib/hippo/concerns/api_path.rb', line 9 def api_path(with_module: false) path = with_module ? to_s : to_s.demodulize path.underscore.dasherize end |
#from_api_path(path) ⇒ Object
14 15 16 |
# File 'lib/hippo/concerns/api_path.rb', line 14 def from_api_path(path) name = path.underscore.camelize.safe_constantize end |