File: non_standard.rb

package info (click to toggle)
mhc 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,320 kB
  • ctags: 3,529
  • sloc: ruby: 12,404; lisp: 7,448; makefile: 70; sh: 69
file content (33 lines) | stat: -rw-r--r-- 922 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module RiCal

  class Component
    #- ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license
    #
    # An NonStandard component represents a component (or subcomponent) not listed in RFC2445.
    # For example some icalendar data contains VVENUE components, a proposed extension to RFC2445
    # which was dropped.
    class NonStandard < Component
      attr_reader :entity_name
      
      def initialize(parent, entity_name)
        super(parent)
        @entity_name = entity_name
        @source_lines = []
      end
      
      def process_line(parser, line) #:nodoc:
        if line[:name] == "BEGIN"
          parse_subcomponent(parser, line)
        else
          @source_lines << parser.last_line_str
        end
      end
      
      def export_properties_to(stream)
        @source_lines.each do |line|
          stream.puts(line)
        end
      end
    end
  end
end