Class: Bypass::Filter
- Inherits:
-
Object
- Object
- Bypass::Filter
- Defined in:
- lib/bypass/filter.rb
Direct Known Subclasses
Constant Summary collapse
- URL_PATTERN =
/\bhttps?:\/\/ [a-zA-Z0-9\-\._~:\/\?#\[\]@!$&'\(\)\*\+,;=%]+ [a-zA-Z0-9\-_~:\/\?#\[\]@!$&\*\+;=%]/x
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#fragment ⇒ Object
readonly
Returns the value of attribute fragment.
Instance Method Summary collapse
-
#initialize(content, options = {}) ⇒ Filter
constructor
A new instance of Filter.
- #replace ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(content, options = {}) ⇒ Filter
Returns a new instance of Filter.
9 10 11 12 |
# File 'lib/bypass/filter.rb', line 9 def initialize(content, = {}) @content = content.to_s.encode("UTF-8") @fragment = .fetch(:fragment, true) end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
3 4 5 |
# File 'lib/bypass/filter.rb', line 3 def content @content end |
#fragment ⇒ Object (readonly)
Returns the value of attribute fragment.
3 4 5 |
# File 'lib/bypass/filter.rb', line 3 def fragment @fragment end |
Instance Method Details
#replace ⇒ Object
14 15 16 |
# File 'lib/bypass/filter.rb', line 14 def replace raise NotImplementedError end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/bypass/filter.rb', line 18 def to_s content end |