class Shortcode::Configuration

Attributes

attribute_quote_type[RW]

Set the quotation sign used for attribute values. Defaults to double quote (“)

block_tags[R]

Set the supported block_tags

check_config_templates_first[RW]

Allows setting whether templates on the configuration are checked first, or templates in the file system

helpers[RW]

Assigns helper modules to be included in templates

presenters[RW]

Allows presenters to be set that can be used to process shortcode arguments before rendered

self_closing_tags[R]

Set the supported self_closing_tags

template_parser[RW]

Sets the template parser to use, supports :erb, :haml, and :slim, default is :haml

template_path[RW]

Sets the path to search for template files

templates[RW]

Allows templates to be set from strings rather than read from the filesystem

use_attribute_quotes[RW]

Allows quotes around attributes to be omitted. Defaults to false (quotes must be present around the value)

Public Class Methods

new() click to toggle source
# File lib/shortcode/configuration.rb, line 39
def initialize
  @template_parser              = :erb
  @template_path                = "app/views/shortcode_templates"
  @templates                    = {}
  @check_config_templates_first = true
  @helpers                      = []
  @block_tags                   = []
  @self_closing_tags            = []
  @attribute_quote_type         = '"'
  @use_attribute_quotes         = true
  @presenters                   = {}
end

Public Instance Methods

block_tags=(block_tags) click to toggle source
# File lib/shortcode/configuration.rb, line 23
def block_tags=(block_tags)
  @block_tags = block_tags.sort_by(&:length).reverse
end
register_presenter(presenter) click to toggle source
# File lib/shortcode/configuration.rb, line 52
def register_presenter(presenter)
  Shortcode::Presenter.register(self, presenter)
end
self_closing_tags=(self_closing_tags) click to toggle source
# File lib/shortcode/configuration.rb, line 29
def self_closing_tags=(self_closing_tags)
  @self_closing_tags = self_closing_tags.sort_by(&:length).reverse
end