Class: Icalendar2::TextValue

Inherits:
Value
  • Object
show all
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

#value

Instance Method Summary collapse

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