Class: Vcard::V4_0::PropertyValue::Fivepartname

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

Returns a new instance of Fivepartname.



363
364
365
366
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 363

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

Instance Method Details

#to_hashObject



377
378
379
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 377

def to_hash
  value
end

#to_sObject



368
369
370
371
372
373
374
375
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 368

def to_s
  ret = Text.listencode value[:surname]
  ret += ";#{Text.listencode value[:givenname]}"
  ret += ";#{Text.listencode value[:additionalname]}"
  ret += ";#{Text.listencode value[:honprefix]}"
  ret += ";#{Text.listencode value[:honsuffix]}"
  ret
end