Module: Outpost::Model::Identifier::ClassMethods
- Defined in:
- lib/outpost/model/identifier.rb
Instance Method Summary collapse
- #content_key ⇒ Object
- #new_obj_key ⇒ Object
- #obj_key(id) ⇒ Object
-
#route_key ⇒ Object
Wrappers for ActiveModel::Naming NewsStory => news_stories.
-
#singular_route_key ⇒ Object
NewsStory => news_story.
Instance Method Details
#content_key ⇒ Object
14 15 16 |
# File 'lib/outpost/model/identifier.rb', line 14 def content_key self.name.tableize.singularize end |
#new_obj_key ⇒ Object
22 23 24 |
# File 'lib/outpost/model/identifier.rb', line 22 def new_obj_key obj_key(nil) end |
#obj_key(id) ⇒ Object
18 19 20 |
# File 'lib/outpost/model/identifier.rb', line 18 def obj_key(id) [self.content_key, id || "new"].join(OBJ_KEY_SEPARATOR) end |
#route_key ⇒ Object
Wrappers for ActiveModel::Naming NewsStory => news_stories
28 29 30 |
# File 'lib/outpost/model/identifier.rb', line 28 def route_key ActiveModel::Naming.route_key(self) end |
#singular_route_key ⇒ Object
NewsStory => news_story
33 34 35 |
# File 'lib/outpost/model/identifier.rb', line 33 def singular_route_key ActiveModel::Naming.singular_route_key(self) end |