Method: Vpim::DirectoryInfo.create
- Defined in:
- lib/vpim/dirinfo.rb
.create(fields = [], profile = nil) ⇒ Object
Create a new DirectoryInfo object. The fields
are an optional array of DirectoryInfo::Field objects to add to the new object, between the BEGIN/END. If the profile
string is not nil, then it is the name of the directory info profile, and the BEGIN:profile
/END:profile
fields will be added.
A DirectoryInfo is mutable, you can add new fields to it using #push(), and see Field#create().
88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/vpim/dirinfo.rb', line 88 def DirectoryInfo.create(fields = [], profile = nil) if profile p = profile.to_str f = [ Field.create('BEGIN', p) ] f.concat fields f.push Field.create('END', p) fields = f end new(fields, profile) end |