Class: RiCal::Component::NonStandard

Inherits:
RiCal::Component show all
Defined in:
lib/ri_cal/component/non_standard.rb

Overview

  • ©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.

Instance Attribute Summary collapse

Attributes inherited from RiCal::Component

#imported

Instance Method Summary collapse

Methods inherited from RiCal::Component

#add_property_date_times_to, #add_subcomponent, #add_x_property, #alarms, #daylight, #default_tzid, entity_name, #export, #export_prop_to, #export_subcomponent_to, #export_to, #export_x_properties_to, #find_timezone, from_parser, #imported?, #initialize_copy, #last_before_local, #last_before_utc, #last_period, #method_missing, parse, parse_string, #parse_subcomponent, #prop_string, #standard, #subcomponent_class, #subcomponents, #time_zone_for, #to_s, #tz_info_source?, #valid?, #x_properties

Constructor Details

#initialize(parent, entity_name) ⇒ NonStandard

Returns a new instance of NonStandard.



14
15
16
17
18
# File 'lib/ri_cal/component/non_standard.rb', line 14

def initialize(parent, entity_name)
  super(parent)
  @entity_name = entity_name
  @source_lines = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RiCal::Component

Instance Attribute Details

#entity_nameObject (readonly)

Returns the value of attribute entity_name.



12
13
14
# File 'lib/ri_cal/component/non_standard.rb', line 12

def entity_name
  @entity_name
end

Instance Method Details

#export_properties_to(stream) ⇒ Object



28
29
30
31
32
# File 'lib/ri_cal/component/non_standard.rb', line 28

def export_properties_to(stream)
  @source_lines.each do |line|
    stream.puts(line)
  end
end

#process_line(parser, line) ⇒ Object

:nodoc:



20
21
22
23
24
25
26
# File 'lib/ri_cal/component/non_standard.rb', line 20

def process_line(parser, line) #:nodoc:
  if line[:name] == "BEGIN"
    parse_subcomponent(parser, line)
  else
    @source_lines << parser.last_line_str
  end
end