Class: Vcard::V4_0::PropertyValue::Utcoffset

Inherits:
Vobject::PropertyValue show all
Defined in:
lib/vobject/vcard/v4_0/propertyvalue.rb

Instance Attribute Summary

Attributes inherited from Vobject::PropertyValue

#errors, #norm, #type, #value

Instance Method Summary collapse

Methods inherited from Vobject::PropertyValue

#<=>, #name, #to_norm

Constructor Details

#initialize(val) ⇒ Utcoffset

Returns a new instance of Utcoffset.



284
285
286
287
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 284

def initialize(val)
  self.value = val
  self.type = "utc-offset"
end

Instance Method Details

#to_hashObject



295
296
297
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 295

def to_hash
  value
end

#to_sObject



289
290
291
292
293
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 289

def to_s
  ret = "#{value[:sign]}#{value[:hr]}#{value[:min]}"
  ret += value[:sec] if value[:sec]
  ret
end