Module: CmsTag::InstanceMethods
- Defined in:
- lib/LucyCMS/cms_tag.rb
Instance Method Summary collapse
-
#ancestors ⇒ Object
Ancestors of this tag constructed during rendering process.
-
#content ⇒ Object
Content that is accociated with Tag instance.
-
#identifier ⇒ Object
String indentifier of the tag.
-
#regex_tag_signature ⇒ Object
Regex that is used to identify instance of the tag Example: /<s*?cms:page:tag_label/.
-
#render ⇒ Object
Content that is used during page rendering.
Instance Method Details
#ancestors ⇒ Object
Ancestors of this tag constructed during rendering process.
49 50 51 52 53 |
# File 'lib/LucyCMS/cms_tag.rb', line 49 def ancestors node, nodes = self, [] nodes << node = node.parent while node.parent nodes end |
#content ⇒ Object
Content that is accociated with Tag instance.
63 64 65 |
# File 'lib/LucyCMS/cms_tag.rb', line 63 def content nil end |
#identifier ⇒ Object
String indentifier of the tag
44 45 46 |
# File 'lib/LucyCMS/cms_tag.rb', line 44 def identifier "#{self.class.name.underscore}_#{self.label}" end |
#regex_tag_signature ⇒ Object
Regex that is used to identify instance of the tag Example:
/<\{\s*?cms:page:tag_label\}/
58 59 60 |
# File 'lib/LucyCMS/cms_tag.rb', line 58 def regex_tag_signature self.class.regex_tag_signature(label) end |
#render ⇒ Object
Content that is used during page rendering. Outputting existing content as a default.
69 70 71 72 73 74 75 76 |
# File 'lib/LucyCMS/cms_tag.rb', line 69 def render # cleaning content from possible irb stuff. Partial and Helper tags are OK. if LucyCms.config.disable_irb && ![CmsTag::Partial, CmsTag::Helper].member?(self.class) content.to_s.gsub('<%', '<%').gsub('%>', '%>') else content.to_s end end |