module Marten::Template::Tag::CanSplitSmartly
Overview
Allows to split expressions by respecting literal values.
This module provides the ability to split string contents by respecting the presence of single-quoted or double-quoted expressions (which can themselves contain spaces):
Tag.split_smartly("This is a 'simple test'") # => ["This", "is", "a", "'simple test'"]
Tag.split_smartly("This is a \"simple test\"") # => ["This", "is", "a", "\"simple test/""]
Direct including types
- Marten::Template::Tag::Asset
- Marten::Template::Tag::Assign
- Marten::Template::Tag::Cache
- Marten::Template::Tag::Capture
- Marten::Template::Tag::CsrfInput
- Marten::Template::Tag::CsrfToken
- Marten::Template::Tag::Extend
- Marten::Template::Tag::For
- Marten::Template::Tag::If
- Marten::Template::Tag::Include
- Marten::Template::Tag::LocalTime
- Marten::Template::Tag::MethodInput
- Marten::Template::Tag::Translate
- Marten::Template::Tag::Unless
- Marten::Template::Tag::Url
Defined in:
marten/template/tag/concerns/can_split_smartly.crInstance Method Summary
-
#split_smartly(expression : String) : Array(String)
Split a string expression and returns an array of strings.
Instance Method Detail
def split_smartly(expression : String) : Array(String)
#
Split a string expression and returns an array of strings.