Class: Tilia::VObject::Splitter::VCard
- Inherits:
-
Object
- Object
- Tilia::VObject::Splitter::VCard
- Includes:
- SplitterInterface
- Defined in:
- lib/tilia/v_object/splitter/v_card.rb
Overview
Splitter.
This class is responsible for splitting up VCard objects.
It is assumed that the input stream contains 1 or more VCARD objects. This class checks for BEGIN:VCARD and END:VCARD and parses each encountered component individually.
Instance Method Summary collapse
-
#initialize(input, options = 0) ⇒ VCard
constructor
Constructor.
-
#next ⇒ Sabre\VObject\Component?
Every time self.next is called, a new object will be parsed, until we hit the end of the stream.
Constructor Details
Instance Method Details
#next ⇒ Sabre\VObject\Component?
Every time self.next is called, a new object will be parsed, until we hit the end of the stream.
When the end is reached, null will be returned.
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/tilia/v_object/splitter/v_card.rb', line 40 def next begin object = @parser.parse unless object.is_a?(Component::VCard) fail ParseException, 'The supplied input contained non-VCARD data.' end rescue EofException return nil end object end |