Class: When::V::Root

Inherits:
BasicTypes::Object show all
Defined in:
lib/when_exe/icalendar.rb

Overview

iCalendar を構成するクラス群の共通抽象クラス

RFC 5545 のクラスは、有無のチェックを除いてProperty の扱いが共通なので、
Property の扱いを、本クラスにまとめて記述している。

Direct Known Subclasses

Calendar, Event, Timezone

Constant Summary collapse

Properties =
[[],[],[],[],[]]
Classes =
nil
DefaultUnique =
['calscale', 'namespace', 'locale']
DefaultOptional =
['x_prop', 'iana_prop']
AwareProperties =
DefaultUnique + 
                      ['tzoffsetfrom', 'tzoffsetto', 'tzname',
'dtstart', 'dtend', 'due',
'repeat', 'duration',
'rrule', 'rdate', 'exdate', 'exevent',
'summary', 'freebusy']

Constants included from Namespace

Namespace::DC, Namespace::DCQ, Namespace::DCT, Namespace::FOAF, Namespace::OWL, Namespace::RDF, Namespace::RDFC, Namespace::RDFS, Namespace::RSS, Namespace::XSD

Instance Attribute Summary collapse

Attributes inherited from BasicTypes::Object

#label

Attributes included from Parts::Resource

#child, #keys, #locale, #namespace

Instance Method Summary collapse

Methods included from Parts::Resource

#[], #^, _instance, _setup_, _setup_info, base_uri, #each, #hierarchy, #included?, #iri, #leaf?, #m17n, #map, #parent, #registered?, root_dir

Methods included from Parts::Resource::Pool

#[], #[]=, #_setup_

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class When::Parts::Resource

Instance Attribute Details

#calscaleWhen::TM::Calendar (readonly)

Note:

RFC 5545 では、'GREGORIAN' のみ指定可能としている。 CALSCALE Property 文字列を capitalize したものに、 prefix _c:(=hosi.org/When/CalendarTypes/)を補い When::TM::Calendar オブジェクトの定義を取得する。

デフォルトのWhen::TM::Calendar

Returns:



104
105
106
# File 'lib/when_exe/icalendar.rb', line 104

def calscale
  @calscale
end

#propertyHash (readonly)

iCalendar クラス群の属性

Returns:

  • (Hash)

    { String => When::Parts::Resource::ContentLine }



92
93
94
# File 'lib/when_exe/icalendar.rb', line 92

def property
  @property
end

Instance Method Details

#include?(date) ⇒ Boolean

指定の日時を含むか?

Parameters:

Returns:

  • (Boolean)
    true - 含む
    false - 含まない


114
115
116
117
118
119
# File 'lib/when_exe/icalendar.rb', line 114

def include?(date)
  first = enum_for(date).next
  return first.include?(date) if first.kind_of?(When::Parts::GeometricComplex)
  return first == date if first.precision <= date.precision
  return false
end