Class: Gidget::Post

Inherits:
Page
  • Object
show all
Defined in:
lib/gidget/post.rb

Instance Attribute Summary

Attributes inherited from Page

#file_path, #meta_data

Instance Method Summary collapse

Methods inherited from Page

#body, #initialize, #method_missing, #title

Constructor Details

This class inherits a constructor from Gidget::Page

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Gidget::Page

Instance Method Details

#dateObject



11
12
13
# File 'lib/gidget/post.rb', line 11

def date
  @meta_data[:date]
end

#request_pathObject



6
7
8
# File 'lib/gidget/post.rb', line 6

def request_path
  @meta_data[:permalink] || self.date.strftime("/%Y/%m/") + self.title.slugize
end

#tagsObject



16
17
18
# File 'lib/gidget/post.rb', line 16

def tags
  @meta_data[:tags] || ""
end