Class: Vcard::V4_0::PropertyValue::Time

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) ⇒ Time

Returns a new instance of Time.



264
265
266
267
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 264

def initialize(val)
  self.value = val
  self.type = "time"
end

Instance Method Details

#to_hashObject



278
279
280
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 278

def to_hash
  value
end

#to_sObject



269
270
271
272
273
274
275
276
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 269

def to_s
  ret = ""
  ret << value[:hour] if value[:hour]
  ret << value[:min] if value[:min]
  ret << value[:sec] if value[:sec]
  ret << value[:zone] if value[:zone]
  ret
end