Class: CodeReaper::Strip
- Inherits:
-
Object
- Object
- CodeReaper::Strip
- Defined in:
- lib/code_reaper/strip.rb
Constant Summary collapse
- STRIP_REGEX =
{ erb: /\<\%(.*?)\%\>/, handlebars: /\{\{(.*?)\}\}/ }
Instance Attribute Summary collapse
-
#str ⇒ Object
readonly
Returns the value of attribute str.
Instance Method Summary collapse
-
#initialize(str) ⇒ Strip
constructor
A new instance of Strip.
- #strip(regex) ⇒ Object
Constructor Details
#initialize(str) ⇒ Strip
Returns a new instance of Strip.
10 11 12 |
# File 'lib/code_reaper/strip.rb', line 10 def initialize str @str = str end |
Instance Attribute Details
#str ⇒ Object (readonly)
Returns the value of attribute str.
3 4 5 |
# File 'lib/code_reaper/strip.rb', line 3 def str @str end |
Instance Method Details
#strip(regex) ⇒ Object
14 15 16 |
# File 'lib/code_reaper/strip.rb', line 14 def strip regex str.gsub filter(regex), '' end |