Class: Jekyll::PostComparer
- Inherits:
-
Object
- Object
- Jekyll::PostComparer
- Defined in:
- lib/jekyll/tags/post_url.rb
Constant Summary collapse
- MATCHER =
/^(.+\/)*(\d+-\d+-\d+)-(.*)$/
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#slug ⇒ Object
Returns the value of attribute slug.
Instance Method Summary collapse
-
#initialize(name) ⇒ PostComparer
constructor
A new instance of PostComparer.
Constructor Details
#initialize(name) ⇒ PostComparer
Returns a new instance of PostComparer.
8 9 10 11 12 |
# File 'lib/jekyll/tags/post_url.rb', line 8 def initialize(name) who, cares, date, slug = *name.match(MATCHER) @slug = slug @date = Time.parse(date) end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
6 7 8 |
# File 'lib/jekyll/tags/post_url.rb', line 6 def date @date end |
#slug ⇒ Object
Returns the value of attribute slug.
6 7 8 |
# File 'lib/jekyll/tags/post_url.rb', line 6 def slug @slug end |