Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/serbea/helpers.rb

Overview

The simplest HTML safety “polyfill” around

Direct Known Subclasses

Serbea::OutputBuffer

Instance Method Summary collapse

Instance Method Details

#html_safeObject



4
5
6
# File 'lib/serbea/helpers.rb', line 4

def html_safe
  self.class.new(self).tap { _1.instance_variable_set(:@html_safe, true) }
end

#html_safe?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/serbea/helpers.rb', line 8

def html_safe?
  instance_variable_get(:@html_safe) == true
end