Class: Brakeman::Messages::Code

Inherits:
Object
  • Object
show all
Defined in:
lib/brakeman/messages.rb

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Code

Returns a new instance of Code.



104
105
106
# File 'lib/brakeman/messages.rb', line 104

def initialize code
  @code = code.to_s
end

Instance Method Details

#to_htmlObject



112
113
114
# File 'lib/brakeman/messages.rb', line 112

def to_html
  "<span class=\"code\">#{CGI.escapeHTML(@code)}</span>"
end

#to_sObject



108
109
110
# File 'lib/brakeman/messages.rb', line 108

def to_s
  "`#{@code}`"
end