Module: Escapement::Attributes
Overview
These methods filter the allowed attributes on entities in order to cut down on the noise returned with the results.
Instance Method Summary collapse
- #a(key, value) ⇒ Object
-
#default(key, value) ⇒ Object
By default we allow no attributes in order to cut down on noise as much as possible.
- #img(key, value) ⇒ Object
Instance Method Details
#a(key, value) ⇒ Object
11 12 13 |
# File 'lib/escapement/attributes.rb', line 11 def a(key, value) true if key == "href" end |
#default(key, value) ⇒ Object
By default we allow no attributes in order to cut down on noise as much as possible. Attributes can be whitelisted on a per-tag basis.
7 8 9 |
# File 'lib/escapement/attributes.rb', line 7 def default(key, value) false end |
#img(key, value) ⇒ Object
15 16 17 |
# File 'lib/escapement/attributes.rb', line 15 def img(key, value) true if ['src', 'width', 'height'].include?(key) end |