class Tilia::VObject::Property::IntegerValue

Integer property.

This object represents INTEGER values. These are always a single integer. They may be preceeded by either + or -.

Public Instance Methods

json_value() click to toggle source

Returns the value, in the format it should be encoded for json.

This method must always return an array.

@return [array]

# File lib/tilia/v_object/property/integer_value.rb, line 43
def json_value
  [value.to_i]
end
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/integer_value.rb, line 24
def raw_mime_dir_value
  @value
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/integer_value.rb, line 17
def raw_mime_dir_value=(val)
  self.value = val.to_i
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/integer_value.rb, line 34
def value_type
  'INTEGER'
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/integer_value.rb, line 53
def xml_value=(value)
  value = value.map(&:to_i)
  super(value)
end