Class: Bijou::EncodeAttributeValue

Inherits:
Filter
  • Object
show all
Defined in:
lib/bijou/filters.rb

Overview

The a filter escapes text intended for HTML tag attribute values.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.apply(input) ⇒ Object



71
72
73
# File 'lib/bijou/filters.rb', line 71

def self.apply(input)
  input.gsub(/&/n, '&amp;').gsub(/\"/n, '&quot;').gsub(/\'/n, '&apos;').gsub(/</n, '&lt;')
end

Instance Method Details

#render(input) ⇒ Object



67
68
69
# File 'lib/bijou/filters.rb', line 67

def render(input)
  "Bijou::EncodeAttribute.apply(#{input})"
end