class Tilia::VObject::Property::UtcOffset
UtcOffset
property.
This object encodes UTC-OFFSET values.
Attributes
delimiter[RW]
In case this is a multi-value property. This string will be used as a delimiter.
@return [String, nil]
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
Tilia::VObject::Property::Text::new
# File lib/tilia/v_object/property/utc_offset.rb, line 49 def initialize(*args) super(*args) @delimiter = nil end
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]
Calls superclass method
Tilia::VObject::Property::Text#json_value
# File lib/tilia/v_object/property/utc_offset.rb, line 43 def json_value super.map do |value| "#{value[0...-2]}:#{value[-2..-1]}" end end
json_value=(value)
click to toggle source
Sets the JSON value, as it would appear in a jCard or jCal object.
The value must always be an array.
@param [array] value
@return [void]
Calls superclass method
Tilia::VObject::Property#json_value=
# File lib/tilia/v_object/property/utc_offset.rb, line 31 def json_value=(value) value = value.map do |v| v.delete(':') end super(value) 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/utc_offset.rb, line 20 def value_type 'UTC-OFFSET' end