Class: RiCal::Component::NonStandard

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

Overview

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.



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

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.



8
9
10
# File 'lib/ri_cal/component/non_standard.rb', line 8

def entity_name
  @entity_name
end

Instance Method Details

#export_properties_to(stream) ⇒ Object



24
25
26
27
28
# File 'lib/ri_cal/component/non_standard.rb', line 24

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

#process_line(parser, line) ⇒ Object

:nodoc:



16
17
18
19
20
21
22
# File 'lib/ri_cal/component/non_standard.rb', line 16

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