Module: Outpost::Model::Identifier::ClassMethods

Defined in:
lib/outpost/model/identifier.rb

Instance Method Summary collapse

Instance Method Details

#content_keyObject



14
15
16
# File 'lib/outpost/model/identifier.rb', line 14

def content_key
  self.name.tableize.singularize
end

#new_obj_keyObject



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_keyObject

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_keyObject

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