Class: Vcard::V4_0::PropertyValue::Gender

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

Returns a new instance of Gender.



316
317
318
319
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 316

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

Instance Method Details

#to_hashObject



327
328
329
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 327

def to_hash
  value
end

#to_sObject



321
322
323
324
325
# File 'lib/vobject/vcard/v4_0/propertyvalue.rb', line 321

def to_s
  ret = value[:sex]
  ret << ";#{value[:gender]}" if !value[:gender].empty?
  ret
end