Class: Icalendar2::TextValue
- Defined in:
- lib/icalendar2/value/text_value.rb
Overview
See tools.ietf.org/html/rfc5545#section-3.3.11 This will escape text passed in, so do not escape it first!
Instance Attribute Summary
Attributes inherited from Value
Instance Method Summary collapse
-
#initialize(value) ⇒ TextValue
constructor
A new instance of TextValue.
Methods inherited from Value
get_factory, matches, #to_s, #valid?
Constructor Details
#initialize(value) ⇒ TextValue
Returns a new instance of TextValue.
6 7 8 9 10 11 12 |
# File 'lib/icalendar2/value/text_value.rb', line 6 def initialize(value) if value.respond_to?(:gsub) super(value.gsub(/\\/, "\\\\\\").gsub(';', '\;').gsub(',', '\,').gsub("\r\n", "\n").gsub("\r", "\n")) else super(value) end end |