Class: CmsTag::Snippet

Inherits:
CmsSnippet
  • Object
show all
Includes:
CmsTag
Defined in:
lib/LucyCMS/cms_tag/snippet.rb

Constant Summary

Constants included from CmsTag

TOKENIZER_REGEX

Instance Attribute Summary

Attributes included from CmsTag

#params, #parent, #record_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CmsSnippet

content_for, initialize_or_find, load_for_slug, load_for_slug!, load_from_file

Class Method Details

.regex_tag_signature(label = nil) ⇒ Object



9
10
11
12
# File 'lib/LucyCMS/cms_tag/snippet.rb', line 9

def self.regex_tag_signature(label = nil)
  label ||= /[\w\-]+/
  /\{\{\s*cms:snippet:(#{label})\s*\}\}/
end

Instance Method Details

#contentObject



14
15
16
# File 'lib/LucyCMS/cms_tag/snippet.rb', line 14

def content
  self.read_attribute(:content)
end

#identifierObject



5
6
7
# File 'lib/LucyCMS/cms_tag/snippet.rb', line 5

def identifier
  "#{self.class.name.underscore}_#{self.slug}"
end