Sha256: ac353171585fe9fe7fa9992a89bc2b9f8e2e40ed32866ea90018040adc17ca39

Contents?: true

Size: 491 Bytes

Versions: 12

Compression:

Stored size: 491 Bytes

Contents

class ComfortableMexicanSofa::Tag::Snippet
  include ComfortableMexicanSofa::Tag
  
  def self.regex_tag_signature(identifier = nil)
    identifier ||= /[\w\-]+/
    /\{\{\s*cms:snippet:(#{identifier})\s*\}\}/
  end
  
  # Find or initialize Comfy::Cms::Snippet object
  def snippet
    blockable.site.snippets.detect{|s| s.identifier == self.identifier.to_s} ||
      blockable.site.snippets.build(:identifier => self.identifier.to_s)
  end
  
  def content
    snippet.content
  end
  
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.12.11 lib/comfortable_mexican_sofa/tags/snippet.rb
comfortable_mexican_sofa-1.12.10 lib/comfortable_mexican_sofa/tags/snippet.rb
comfortable_mexican_sofa-1.12.9 lib/comfortable_mexican_sofa/tags/snippet.rb
comfortable_mexican_sofa-1.12.8 lib/comfortable_mexican_sofa/tags/snippet.rb
comfortable_mexican_sofa-1.12.7 lib/comfortable_mexican_sofa/tags/snippet.rb
comfortable_mexican_sofa-1.12.6 lib/comfortable_mexican_sofa/tags/snippet.rb
comfortable_mexican_sofa-1.12.5 lib/comfortable_mexican_sofa/tags/snippet.rb
comfortable_mexican_sofa-1.12.4 lib/comfortable_mexican_sofa/tags/snippet.rb
comfortable_mexican_sofa-1.12.3 lib/comfortable_mexican_sofa/tags/snippet.rb
comfortable_mexican_sofa-1.12.2 lib/comfortable_mexican_sofa/tags/snippet.rb
comfortable_mexican_sofa-1.12.1 lib/comfortable_mexican_sofa/tags/snippet.rb
comfortable_mexican_sofa-1.12.0 lib/comfortable_mexican_sofa/tags/snippet.rb