Module: Morpheus::Mixins::UrlSupport::ClassMethods
- Defined in:
- lib/morpheus/mixins/url_support.rb
Instance Method Summary collapse
- #attributes_root ⇒ Object
- #plural_url_name ⇒ Object
- #set_attributes_root(name) ⇒ Object
- #set_base_model_name(name) ⇒ Object
- #set_base_url(url_name) ⇒ Object
- #url_name ⇒ Object (also: #singular_url_name)
Instance Method Details
#attributes_root ⇒ Object
24 25 26 |
# File 'lib/morpheus/mixins/url_support.rb', line 24 def attributes_root @attributes_root ||= model_name.underscore end |
#plural_url_name ⇒ Object
16 17 18 |
# File 'lib/morpheus/mixins/url_support.rb', line 16 def plural_url_name url_name.pluralize end |
#set_attributes_root(name) ⇒ Object
28 29 30 |
# File 'lib/morpheus/mixins/url_support.rb', line 28 def set_attributes_root(name) @attributes_root = name end |
#set_base_model_name(name) ⇒ Object
32 33 34 35 |
# File 'lib/morpheus/mixins/url_support.rb', line 32 def set_base_model_name(name) set_base_url(name) set_attributes_root(name) end |
#set_base_url(url_name) ⇒ Object
20 21 22 |
# File 'lib/morpheus/mixins/url_support.rb', line 20 def set_base_url(url_name) @url_name = url_name end |
#url_name ⇒ Object Also known as: singular_url_name
11 12 13 |
# File 'lib/morpheus/mixins/url_support.rb', line 11 def url_name @url_name ||= model_name.underscore end |