Class: Vcard::V4_0::PropertyValue::Address

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

Returns a new instance of Address.



383
384
385
386
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 383

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

Instance Method Details

#to_hashObject



399
400
401
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 399

def to_hash
  value
end

#to_sObject



388
389
390
391
392
393
394
395
396
397
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 388

def to_s
  ret = Text.listencode value[:pobox]
  ret += ";#{Text.listencode value[:ext]}"
  ret += ";#{Text.listencode value[:street]}"
  ret += ";#{Text.listencode value[:locality]}"
  ret += ";#{Text.listencode value[:region]}"
  ret += ";#{Text.listencode value[:code]}"
  ret += ";#{Text.listencode value[:country]}"
  ret
end