Class: Docs::PageCategory
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Docs::PageCategory
- Extended by:
- FriendlyId
- Defined in:
- app/models/docs/page_category.rb
Instance Method Summary collapse
Instance Method Details
#only_title ⇒ Object
17 18 19 |
# File 'app/models/docs/page_category.rb', line 17 def only_title @captures ||= splitted_title[1] end |
#splitted_title ⇒ Object
21 22 23 |
# File 'app/models/docs/page_category.rb', line 21 def splitted_title @splitted_title ||= title.match(/^(?:(\d+)\. )?(.+)$/).captures end |
#weight ⇒ Object
13 14 15 |
# File 'app/models/docs/page_category.rb', line 13 def weight @weight ||= splitted_title[0].to_i.nonzero? || 100 end |