Class: Tilia::VObject::Property::ICalendar::CalAddress

Inherits:
Text show all
Defined in:
lib/tilia/v_object/property/i_calendar/cal_address.rb

Overview

CalAddress property.

This object encodes CAL-ADDRESS values, as defined in rfc5545

Constant Summary

Constants inherited from Node

Node::PROFILE_CALDAV, Node::PROFILE_CARDDAV, Node::REPAIR

Instance Attribute Summary collapse

Attributes inherited from Tilia::VObject::Property

#group, #name, #parameters, #value

Attributes inherited from Node

#iterator, #parent

Instance Method Summary collapse

Methods inherited from Text

#json_value, #quoted_printable_value=, #raw_mime_dir_value, #raw_mime_dir_value=, #serialize, #validate

Methods inherited from Tilia::VObject::Property

#==, #[], #[]=, #add, #delete, #destroy, #initialize_copy, #json_serialize, #json_value, #json_value=, #key?, #parts, #parts=, #raw_mime_dir_value, #raw_mime_dir_value=, #serialize, #to_s, #validate, #xml_serialize, #xml_value=

Methods inherited from Node

#==, #[], #[]=, #delete, #destroy, #each, #json_serialize, #key?, #serialize, #size, #validate, #xml_serialize

Constructor Details

#initialize(*args) ⇒ CalAddress

Returns a new instance of CalAddress.



41
42
43
44
# File 'lib/tilia/v_object/property/i_calendar/cal_address.rb', line 41

def initialize(*args)
  super(*args)
  @delimiter = nil
end

Instance Attribute Details

#delimiterString?

In case this is a multi-value property. This string will be used as a delimiter.

Returns:

  • (String, nil)


13
14
15
# File 'lib/tilia/v_object/property/i_calendar/cal_address.rb', line 13

def delimiter
  @delimiter
end

Instance Method Details

#normalized_valueString

This returns a normalized form of the value.

This is primarily used right now to turn mixed-cased schemes in user uris to lower-case.

Evolution in particular tends to encode mailto: as MAILTO:.

Returns:

  • (String)


33
34
35
36
37
38
39
# File 'lib/tilia/v_object/property/i_calendar/cal_address.rb', line 33

def normalized_value
  input = value
  return input unless input.index(':')

  (schema, everything_else) = input.split(':', 2)
  "#{schema.downcase}:#{everything_else}"
end

#value_typeString

Returns the type of value.

This corresponds to the VALUE= parameter. Every property also has a ‘default’ valueType.

Returns:

  • (String)


21
22
23
# File 'lib/tilia/v_object/property/i_calendar/cal_address.rb', line 21

def value_type
  'CAL-ADDRESS'
end