Class: Amrita2::Util::SanitizedString

Inherits:
String show all
Defined in:
lib/amrita2/template.rb

Overview

Amrita2 sanitize anything except for SanitizedString If you want to sanitize yourself and don’t want to Amrita2 sanitize your object, pass SanitizedString as model data.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.[](s) ⇒ Object



165
166
167
# File 'lib/amrita2/template.rb', line 165

def SanitizedString::[](s)
  new(s.to_s).freeze
end

Instance Method Details

#*(n) ⇒ Object



177
178
179
# File 'lib/amrita2/template.rb', line 177

def *(n)
  SanitizedString[super]
end

#amrita_valueObject



169
170
171
# File 'lib/amrita2/template.rb', line 169

def amrita_value
  self
end

#inspectObject



181
182
183
# File 'lib/amrita2/template.rb', line 181

def inspect
  %[SanitizedString[#{super}]]
end

#to_sObject



173
174
175
# File 'lib/amrita2/template.rb', line 173

def to_s
  self
end