Class: Lookbook::ActionViewAnnotationsStripper

Inherits:
Service
  • Object
show all
Defined in:
lib/lookbook/services/templates/action_view_annotations_stripper.rb

Constant Summary collapse

ANNOTATIONS_REGEX =
/<!-- (BEGIN|END) (.*) -->/

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Service

call

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

#textObject (readonly)



3
4
5
# File 'lib/lookbook/services/templates/action_view_annotations_stripper.rb', line 3

def text
  @text
end

Instance Method Details

#callObject



11
12
13
# File 'lib/lookbook/services/templates/action_view_annotations_stripper.rb', line 11

def call
  text.gsub(ANNOTATIONS_REGEX, "")
end