class Tilia::VObject::Property::Boolean

Boolean property.

This object represents BOOLEAN values. These are always the case-insenstive string TRUE or FALSE.

Automatic conversion to PHP's true and false are done.

Public Instance Methods

raw_mime_dir_value() click to toggle source

Returns a raw mime-dir representation of the value.

@return [String]

# File lib/tilia/v_object/property/boolean.rb, line 27
def raw_mime_dir_value
  @value ? 'TRUE' : 'FALSE'
end
raw_mime_dir_value=(val) click to toggle source

Sets a raw value coming from a mimedir (iCalendar/vCard) file.

This has been 'unfolded', so only 1 line will be passed. Unescaping is not yet done, but parameters are not included.

@param [String] val

@return [void]

# File lib/tilia/v_object/property/boolean.rb, line 19
def raw_mime_dir_value=(val)
  val = val.upcase == 'TRUE' ? true : false
  self.value = val
end
value_type() click to toggle source

Returns the type of value.

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

@return [String]

# File lib/tilia/v_object/property/boolean.rb, line 37
def value_type
  'BOOLEAN'
end
xml_value=(value) click to toggle source

Hydrate data from a XML subtree, as it would appear in a xCard or xCal object.

@param [array] value

@return [void]

Calls superclass method Tilia::VObject::Property#xml_value=
# File lib/tilia/v_object/property/boolean.rb, line 47
def xml_value=(value)
  value = value.map do |v|
    'true' == v
  end

  super(value)
end