Class: Wst::MdContent
Constant Summary collapse
- @@matcher =
/^(.+\/)*(\d+-\d+-\d+)?-?(.*)(\.[^.]+)$/
Class Method Summary collapse
Instance Method Summary collapse
- #date ⇒ Object
-
#initialize(file_path) ⇒ MdContent
constructor
A new instance of MdContent.
- #raw_content ⇒ Object
Methods inherited from Content
#account, #account?, #child, #content, #datas, #dir, #gravatar, #gravatar?, #method_missing, #url, #url=
Methods included from Configuration
#config, config, #defaultLinks, defaultLinks, links_file_path, read_config, read_configuration, read_default_links, read_translations, translation_files, valid_location?
Constructor Details
#initialize(file_path) ⇒ MdContent
Returns a new instance of MdContent.
9 10 11 12 13 14 15 16 17 |
# File 'lib/md_content.rb', line 9 def initialize file_path super file_path m, cats, date, slug, ext = *file_path.match(@@matcher) @cats = cats @date = Time.parse(date) if date @slug = slug @ext = ext end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Wst::Content
Class Method Details
.matcher ⇒ Object
31 32 33 |
# File 'lib/md_content.rb', line 31 def self.matcher @@matcher end |
Instance Method Details
#date ⇒ Object
19 20 21 |
# File 'lib/md_content.rb', line 19 def date @date end |
#raw_content ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/md_content.rb', line 23 def raw_content if useDefaultLinks? content_with_links else @plain_content end end |