Class: Trenni::MarkupString
- Inherits:
-
String
- Object
- String
- Trenni::MarkupString
- Includes:
- Markup, Trenni_Markup
- Defined in:
- lib/trenni/markup.rb,
ext/trenni/escape.c
Overview
Initialized from text which is escaped to use HTML entities.
Class Method Summary collapse
-
.raw(string) ⇒ Object
Generate a valid MarkupString withot any escaping.
Instance Method Summary collapse
-
#initialize(string = nil, escape = true) ⇒ MarkupString
constructor
A new instance of MarkupString.
Methods included from Markup
Constructor Details
#initialize(string = nil, escape = true) ⇒ MarkupString
Returns a new instance of MarkupString.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/trenni/markup.rb', line 50 def initialize(string = nil, escape = true) if string if escape string = Markup.escape_string(string) end super(string) else super() end end |
Class Method Details
.raw(string) ⇒ Object
Generate a valid MarkupString withot any escaping.
63 64 65 |
# File 'lib/trenni/markup.rb', line 63 def self.raw(string) self.new(string, false) end |