Class: Vcard::V4_0::Component

Inherits:
Vobject::Component show all
Defined in:
lib/vobject/vcard/v4_0/component.rb

Instance Attribute Summary

Attributes inherited from Vobject::Component

#children, #comp_name, #errors, #multiple_components, #norm

Class Method Summary collapse

Methods inherited from Vobject::Component

#<=>, #blank, #child_class, #get_errors, #initialize, #name, #to_hash, #to_json, #to_norm, #to_s

Constructor Details

This class inherits a constructor from Vobject::Component

Class Method Details

.parse(vcf, strict) ⇒ Object



9
10
11
12
13
# File 'lib/vobject/vcard/v4_0/component.rb', line 9

def parse(vcf, strict)
  hash = Vcard::V4_0::Grammar.new(strict).parse(vcf)
  comp_name = hash.keys.first
  new comp_name, hash[comp_name], hash[:errors]
end