Class: Icalendar::Values::Text
- Inherits:
-
Icalendar::Value
- Object
- SimpleDelegator
- Icalendar::Value
- Icalendar::Values::Text
- Defined in:
- lib/icalendar/values/text.rb
Instance Attribute Summary
Attributes inherited from Icalendar::Value
Instance Method Summary collapse
-
#initialize(value, params = {}) ⇒ Text
constructor
A new instance of Text.
- #value_ical ⇒ Object
Methods inherited from Icalendar::Value
#ical_param, #params_ical, #to_ical, #value, value_type
Constructor Details
#initialize(value, params = {}) ⇒ Text
Returns a new instance of Text.
6 7 8 9 10 11 12 |
# File 'lib/icalendar/values/text.rb', line 6 def initialize(value, params = {}) value = value.gsub '\n', "\n" value.gsub! '\,', ',' value.gsub! '\;', ';' value.gsub!('\\\\') { '\\' } super value, params end |
Instance Method Details
#value_ical ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/icalendar/values/text.rb', line 14 def value_ical value.dup.tap do |v| v.gsub!('\\') { '\\\\' } v.gsub! ';', '\;' v.gsub! ',', '\,' v.gsub! /\r?\n/, '\n' end end |