Class: Lookbook::ActionViewAnnotationsStripper
- Defined in:
- lib/lookbook/services/templates/action_view_annotations_stripper.rb
Constant Summary collapse
- ANNOTATIONS_REGEX =
/<!-- (BEGIN|END) (.*) -->/
Instance Attribute Summary collapse
- #text ⇒ Object readonly
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(text) ⇒ ActionViewAnnotationsStripper
constructor
A new instance of ActionViewAnnotationsStripper.
Methods inherited from Service
Constructor Details
#initialize(text) ⇒ ActionViewAnnotationsStripper
Returns a new instance of ActionViewAnnotationsStripper.
7 8 9 |
# File 'lib/lookbook/services/templates/action_view_annotations_stripper.rb', line 7 def initialize(text) @text = text.to_s end |
Instance Attribute Details
#text ⇒ Object (readonly)
3 4 5 |
# File 'lib/lookbook/services/templates/action_view_annotations_stripper.rb', line 3 def text @text end |
Instance Method Details
#call ⇒ Object
11 12 13 |
# File 'lib/lookbook/services/templates/action_view_annotations_stripper.rb', line 11 def call text.gsub(ANNOTATIONS_REGEX, "") end |