Class: Ahnnotate::Function::StripSchema

Inherits:
Object
  • Object
show all
Defined in:
lib/ahnnotate/function/strip_schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(comment:) ⇒ StripSchema

Returns a new instance of StripSchema.



6
7
8
# File 'lib/ahnnotate/function/strip_schema.rb', line 6

def initialize(comment:)
  @comment = comment
end

Instance Attribute Details

#commentObject (readonly)

Returns the value of attribute comment.



4
5
6
# File 'lib/ahnnotate/function/strip_schema.rb', line 4

def comment
  @comment
end

Instance Method Details

#call(content) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/ahnnotate/function/strip_schema.rb', line 10

def call(content)
  matches = pattern.match(content)

  if matches
    matches["post"]
  else
    content
  end
end